It is done! The final version of the hardware sits on my living room wall in a nice wooden frame. The software works, too! Apart from the fact that SoundCloud don’t give out new API keys to developers of apps everything works perfectly. It just means that I have to search for a new random API key myself and save it to my Arduino Programm running on the WeMos. Also I had to tweak the php script running on my webserver. Remember that the Arduino gets the actual number to display from this php script because it doesn’t have sufficient memory to calculate it on-board. So php does the “heavy lifting” for it. SoundCloud API has some wonderful quirks to work around. The list of tracks it returns for a given user has 50 entries max. If a user has more tracks, you must use a paginated variant of the API call. This way you get multiple answers. But: in the chunks of 50 tracks some of the tracks can occur in two different chunks. So you have to check if you encountered a given track ID before, and only if not save that track’s play_count.
Still there remains a discrepancy between the plays my script calculates and the plays shown in the official SoundCloud “Pulse” App. This is due in to some hidden (non-public but scheduled for release) tracks that have a few plays which are not returned by the API call.
One of my Arduino sketches was getting this total play count from the PHP script by calling it up and put the number into a variable. The other Arduino sketch can take any given number and send it to the shift registers so that the corresponding glyphs inside the Nixie tubes light up.
Marrying the two Arduino sketches that I got working was actually easier than I thought. To test the result I added a routine that makes the Nixies count from 0 to 9 in unison. This is also helpful to prevent what is called cathode poisoning. It occurs if one of a Nixie’s glyph stays lit for too long. That’s why I make the Nixies cycle through all their glyphs overtime the total play count changes.
So far I have only added one actual Nixie tube to my breadboard test setup. I have yet to solder all the connections to the rest of my Nixies.
Next I had to come up with some Arduino methods that would take a number and make a series of 0s and 1s out of it and then output those through the pins of my chip to the shift registers that are switching the Nixie digits on and off.
This is the Arduino sketch I made. Without a lot of help of my dear friend O. I wouldn’t have made it. If you want to have a look, you can download the sketch.
I then attached some LEDs instead of the first Nixie Tube so I could check the functionality without getting involved into that horrid 160V business just yet.