28 Oct 2025 ------------ Fun time: Arduino Due to recent changes of my computing equipment, a defective Pico 2, regrets from owning too many Cortex M0 boards, Adafruit boards, I decided to give Arduino a go. I think microcontrollers, small electronics, tinkering materials, they have some kind of charm. It is a great mix of software and hardware, brings ideas to the physical world. Just not sure why, I didn't start with Arduino. My first development board was a BBC Micro:bit. It was a buy-it-first-worry-about-it-later kind of thing, to a point that I didn't think about what were the possible ways to program it. Now I think there were 2 factors - I thought faster MCU means more useful, and I liked that it packs with many on-board peripherals. The thing I built was a car crusher. A tissue box would go down and cover the toy car beneath it. Enough to make a 3-year-old believed the toy car really got crushed and cried when his dad couldn't stop laughing (He figured that out in a minute). To make it I just needed the board, a right servo driver, a continuous rotation servo, and a right toolchain to build the program. That time I used TinyGo, because it looked easy enough. It was indeed easy, I just picked up a wrong project - to move a servo motor, PWM is the way to do. PWM is a technique to generate electric waveforms that go up and down at different frequencies. So if the wave goes up for 120 ms and goes down for 80 ms, the servo turns clockwise; If we make it 80 ms up 120 ms down, it in turn goes anti-clockwise. A concept like that. Back in the days, TinyGo for Micro:bit didn't have PWM support. I was thinking whether I should abandon the project. May be a scary mask would be an easier way to make a kid cry? But that doesn't hurt to try! I used sleeps, basically relying on the the microcontroller's clock to programmatically produce ons and offs at the signal pin with different rhythm. To my surprise, it worked. :O That's where the thing went wrong - when you got a taste of success, you will go down into the rabbit hole. I started buying more other kinds of boards, and looked for a "better" toolchain to program them. If I remember correctly, I bought the Adafruit Feather M0 WiFi next (that's why I loved it the most), and the LoRa variant of that, then some nRF52 for Bluetooth, and some ESP ones to understand why they are so popular. I used Zephyr RTOS, mainly by copying from sample codes without really understanding what was happening behind it. Simple Bluetooth projects worked quite well on those nRF52s, but the binary was too big when I coded too many things for the Feather M0 WiFi. I then wanted some quick wins, because Zephyr Project is still a little bit complicated to me. I then tried CircuitPython, my first time using Python, and I couldn't explain why. Python is simple, but doesn't feel good...I used it on the ESP boards. They worked, just slow. I think I continued to explore Zephyr until I switched to the OpenBSD Kangaroo mini PC. Couldn't get the toolchains to work on my PC, so I stopped playing with the MCUs for a while. I was still thinking about ways, and one day I got some advice to start learning with AVR 8-bit MCUs. I went for ATTiny85, a spider-like IC that needs hardware programmer to flash. It is more like bare-metal programming, and the GCC, libc, AVRDUDE tool were easy to setup on OpenBSD. I bought as well a starter kit which has 10 experiments and quite a few components to play with. I read the datasheet and started to understand what was happening inside the IC. It is Oidhche Shamhna (i.e. Halloween) soon! I want to make a blinky-blinky cape for my kid. I ordered a NeoPixel strip but was thinking how to light it up with an ATTiny85, or an Arduino Uno that I bought a few months ago. Time is tight but by chance I have a Debian-based system now on my Librem 5, so why don't I try Arduino? To be honest, the timing was not good. I thought about it but then the news about Arduino being acquired by Qualcomm came out. More like a psychological thing but I hesitated. But to make that blinky-blinky cape work, I have to try it at least. I was prepared to spend a few days to make it work, but the LED strip started blinking after I put a slightly modified example Arduino code into it. That's quick...I showed my son and he loved it, even attempted to monopolise it. We kept it on until very late night, then I unplugged it. I didn't want him to be unhappy the next day though, so I made a tiny traffic light... I used a traffic light board. Easy enough to operate - 4 pins, red, yellow, green, and ground. I was glad that I bought some funny Olimex boards, and the USB-PWR really saved life. I put the USB-PWR, a tiny breadboard power source, onto a mini breadboard. This time I used an ATTiny85, because the project looks simple enough. However, I didn't want to make it normal, so I have added a logic that when a button is pressed, the 3 lights will flash randomly. After putting the IC, a button, and some jumper wires to connect the pins, the traffic light was done! (Okay...I got the condition wrong the first time, so the lights flashed randomly when the button was not pressed...) I didn't think the traffic light would be that funny to my kid. I thought it was just some cheap programming trick. Turned out my little one couldn't stop laughing when he saw the lights went crazy. We even started playing traffic light game which I would stop moving when it was red, and move only on green. In the end, he likes the normal pattern more. Didn't expect all this. I think Arduino is quite good, if we talk about how it abstracts the register level details to make quick wins possible. I think it is good for students and people who don't work as programmer. I like the bare- metal way a lot more because it feels more straightforward. It is logical. It makes sense to me. And I like programming the MCU without needing to worry about whether I have the right bootloader in the chip. I started to learn that clock speed may not be an issue in my use cases, and I was happily using 10 Mhz ATTiny85s. The built-in capabilities to do PWM, ADC, etc. are as well very practical. I now like the AVR MCUs more!