RSSAmplifier

Blog

Martyn Davis | Marengo

Software Development and Other Stuff

martyndavis.comRSS feed ↗10 posts

Latest posts

CMake Makefile

CMake has plenty of advantages, I don t need to re-iterate them here. However, if you re like me, who lives on the command line and has ./configure and make seemingly hard-wired into my fingers, it seems a bit cumbersome to have to type mkdir build, cd build, and (for example) cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON each time Continue reading "CMake Makefile"

std::visit and std::variant

If you ve got a set of types, and you need to iterate over them and do something with each of them, your initial instinct would probably be to make them related. For example, if we had a set of application menu commands, we might make them all inherit from a pure virtual base class (let s Continue reading "std::visit and std::variant"

“littlefs” Missing When Compiling with ESPHome

If you ve got ESPHome installed on an Apple Silicon Mac via Homebrew, you might have noticed a compilation error complaining about littlefs missing on all projects. I haven t dug too deeply into this. I suspect it s a Homebrew dependency issue, but the solution was to go to the following directory (note this might change depending Continue reading " littlefs Missing When Compiling with ESPHome"

An Interesting Bug

A few years ago I wrote the C++ program latheControl which is designed to control my lathe (and subsequently my milling maching, and rotary table) by moving the machine s axes via stepper motors. It s designed to be an aid to manual machining rather than going the full CNC route. It consists of a low-priority UI Continue reading "An Interesting Bug"

Solving Word Games with Rust

If you enjoy word games (such as cryptic crosswords) as I do, then this is a really useful tool for you. It can be used in many ways. For example, if you re trying to solve an anagram, you could type lookup GSNIGNI and it will give you output like this: S G N G I Continue reading "Solving Word Games with Rust"

Rust Projects

I ve been having a lot of fun recently learning Rust. It s a breath of fresh air in so many ways compared to C++: for instance the standardised package management, a consistent way of building projects, and simple-to-add unit tests. These are in addition to the much-touted safer memory management. We won t be giving up with Continue reading "Rust Projects"

Non-Metric Threads on the Lathe Using C++

I continue to improve the lathe application I ve written it s working really well. Several major improvements recently include a graphical user interface to allow better display of information, stepper control of the X axis, and the ability to cut tapers by controlling the Z and X axis simultaneously. Yesterday I wanted to cut a Continue reading "Non-Metric Threads on the Lathe Using C++"

Controlling a Rotary Table with C++

As part of the project to control my metalworking lathe with a stepper motor (see https://www.martyndavis.com/?p=726), I ve decided it would be useful to make some additional gears to step down the speed of the rotary encoder in relation to the lathe s spindle. Here s the first one I created (I haven t cut a keyway in it Continue reading "Controlling a Rotary Table with C++"

Controlling a Lathe with C++

This is a quick post I m intending on going into far more detail about this at a later stage but recently, for fun, I ve been working on automating some functions on a metalworking lathe. It s been a really interesting project I ve been driving a fairly powerful stepper motor to give accuracy of Continue reading "Controlling a Lathe with C++"

Using libjpeg in C++

Just for fun I thought it would be interesting to write a quick program to convert .jpg images to an ASCII representation. Here s a sample output: I was surprised that there are not more examples online showing how to use libjpeg, and even fewer wrapping it in a more cpp-friendly manner. I decided to make Continue reading "Using libjpeg in C++"