Andrew Kesterson

"Love God. Live Righteously. Die Well."
Source Code || LinkedIn
38 Posts 9 Categories 0 Tags
Categories
Books 14
Philosophy 9
Faith 7
Technology 17
Outdoors 1
Current-Events 7
Leadership 8
History 1
Liberal-Education 1
hot tags

# Devlog Entry - 8 June 2026

2026-06-08 Technology 802 words

## libakgl updates

- Tilemaps can now contain their own physics properties. This allows you to specify different gravity, drag, and even entirely different physics simulators in the map properties. Something about reading the physics simulation values from the map rather than the overall game properties makes the gravity behave differently, so the values need to be tweaked a little bit, but it still works fine.

    "properties":[
           {
            "name":"physics.drag.y",
            "type":"float",
            "value":0
           },
           {
            "name":"physics.gravity.y",
            "type":"float",
            "value":0
           },
           {
            "name":"physics.model",
            "type":"string",
            "value":"arcade"
           }],

## libakerror new error type

libakerror now includes a new error type, `AKERR_CIRCULAR_REFERENCE` for things like linked lists or trees that are self-referential.

## ESP32 Projects

This week was basically one long episode of “Wait I thought I knew how that worked … Oh I didn’t understand … but now I do!”. Overall it was a good week.

### Using Analog to Digital Converters, Potentiometers and Capacitive Touch Sensors

> Fun with potentiometers and the esp32 analog to digital converter. It was fluttering around at zero until the camera came on pic.twitter.com/U6Xi5qF4Pz

> — Andrew Kesterson (@AKLabsDotNet) June 1, 2026

This project lets you control a couple of LEDs with a potentiometer and a capacitive touch sensor, using the potentiometer through the analog to digital converter as a dimmer for the green LED vi PWM, and using the capacitive touch sensor as an on/off switch for the red LED.

Lessons learned from this project:

- How potentiometers actually work (surprise: it’s more complicated than I thought, as usual)
- How an ADC works
- How the ESP32-S3 ADC in particular works
- How to build a Flash ADC on a breadboard (note: I didn’t get around to actually BUILDING the flash ADC I mention in the article. I need to go back and do that.)
- How integrated circuits measure capacitance

There is a more detailed writeup about this project in my source repository

### Photoresistors and Voltage Dividers

This project uses a photoresistor feeding into the ADC and an LED fed with PWM to create a nightlight that gets brighter as the ambient light gets darker.

The code in this lesson is unremarkable; the lessons here were primarily in correcting some fundamental misunderstandings in my basic electronics knowledge.

- Resistors in a circuit don’t work the way I thought they did
- How a voltage divider actually works and why we might use one
- How a photoresistor actually works under the hood

There is a LOT tied up in what I learned about voltage dividers and photoresistors. I had some pretty fundamental misunderstandings about how circuits worked, and if you went through the same kinds of tutorials I did, you may too. There is a more detailed writeup about this project in my source repository

### Joystick and WS2812 LED demo

> Putting together almost everything I’ve learned about arduino and esp32 over the past few weeks to make a joystick blinks lights demo with calibration. Challenging but very fun. pic.twitter.com/7blqqQOlYg

> — Andrew Kesterson (@AKLabsDotNet) June 6, 2026

This demo project shows using a joystick peripheral to control the position of an LED light on a WS2812 light strip, as well as how to calibrate a joystick, while using PWM driven LEDs to show the relative position of a joystick on its axis and the status of the momentary joystick pushbutton. The breadboard picture above shows a WS2812 horizontal strip, but that’s not what I used; mine was a circular LED arrangement, I just couldn’t find the right part in Fritzing.

Lessons learned from this project:

- Fritzing is time consuming but neat
- I still don’t trust C++
- How the RMT peripheral on the ESP32-S3 works and why it is involved when driving WS2812 LED strips
- How to select pin assignments on the ESP32 without relying on the tutorial
- How to calibrate joysticks

There’s quite a bit of info packed in to the writeup on this one - at least I feel like there is. There’s some discussion of the code too so that may make it look bigger than it actually is. The writeup on the WS2812 protocol, in all its beautiful wierdness, may be enough to justify the read. There is a more detailed writeup about this project in my source repository.

## Closing Thoughts

I am very very ready to leave Arduino behind and move on to the projects in Bare-Metal Embedded C Programming on STM32, but I think I should do some more projects with Arduino first. Every time I do, I find some new electronics fundamental I didn’t understand as well as I thought, or find some habit that will probably bite me when I get into the really low level stuff. So I think we have to stay with Arduino for a while longer.

Recent Posts
2026-07-10
News-2026-Week-2
2026-07-09
News - 2026 - Week - 28
2026-06-30
Just Be Yourself ... Whoever that is
2026-06-30
You Cant Go Home Again