Category: Compendium

FadeLed Arduino library

This is going to be a small post. I came across the question how to fade a led. In basic it’s not that hard to do, just increment the brightness in steps every x period of time. But when you start to write code for it it starts to become more complicated. Not hard, but only more work then you might initially think. For example, how do you determined the steps and the periods you need? And do you want to fade with a constant speed or in a constant time?

To make it easy for everybody (including future me) to fade a led on an Arduino hardware PWM pin I started to write a small library. But mostly it became a practice of fully documenting a project using Doxygen, putting out releases on GitHub including main pages etc.

If you want to jump straight to the library:  septillion-git/FadeLed

Read More

The big ARM adventure – part 1

I’ve been programming 8-bit micro controllers for some years now. I started with PIC (PIC16F628, like everybody else), bought a PicKit 2 (because that did work on a 64-bit OS) and started coding in CCS C. Looking back it’s all terrible but it got me going. Of course I can across some AVR code but I never used it until the whole Arduino revolution. A friend wanted to do some stuff with Arduino so I helped him out and I started looking at Arduino myself. Mostly because you can buy Pro Mini’s (with all components already on a board) so dirt cheap from China it really is a no-brainer. I looked at some 32-bit stuff and bought some Ti Launchpads etc. But never really got my head around it and because I never needed it I stayed with 8-bitters.

Then I came across a post on Hackaday about repurposing a AVR-programmer as a USB Arduino. I’ve seen those modules thousands of times on eBay but never bought one. (I use a Arduino as ISP.) Although the hack is neat I don’t find it very useful because of the limited I/O. For less you can just use a Nano with a lot more I/O. (Okay, you can’t present it as a HID or something else.) I started reading the comments to see how other people thought about it and then I spotted something that I found interesting. Especially the comment of [wongsta / drojf] about cheap ARM boards. So I fired up eBay and looked up that STM32F103C8T6 he talked about. And well be damned, even cheaper then the $3,50 he talked about. So I ordered a board right away. Together with a STlink v2 that was mentioned there.

Read More