FLiP Holiday Kit Test/Demo Code
As creatives, we all have our own way, so this is my way about the Holiday Kit. The wiring is the same as with the Parallax demo.
Once I started my test code I found that the pixels don't need the Red/Green swap that is required by the WS2812b pixels, so I switched the driver to an updated WS2811 driver. All of the interface methods are the same, there's just a small difference in the PASM driver.
My tones and music generation doesn't use an external object; it's built into the main project (I call this an embedded object). I have programmed many laser tag and escape room props that needed simple beeps, boops, and monotonic music, so the code attached is based on what I've been doing for the last eight years. The up-shot is that being internal allows you to stop the music any time. The background cog that runs the music runs every millisecond which provides a convenient timing mechanism. And over the years I found that you can get a lot of work done in 1ms running Spin1 and 80MHz. That is to say that you can add features to the background if desired (e.g., button debouncing).
Even though I call this a tester, it has several lighting animations and some music, including "Oh, Christmas Tree" and "The Dreidel Song."
I wrote and tested this in Propeller Tool (because it's like an old, comfortable pair of jeans), and also tested in Spin Tools IDE. If using the latter, you can turn off the line input for the PST terminal emulation so that it behaves like PST. If you have line input enabled, you need to press Enter.
Have fun, and let me know if you run into any snags.
Comments
Cool, thanks Jon.
Anyone wanting to add this to the existing "Run" menu in the Holiday Kit WiFi module's built-in menu system (reset 3-press), just upload the attached binary file using the WiFi module web-gui "Files" tab.
Tips:
Alternatively, if Jon's code is loaded direct to FLiP EEPROM (F11 from Propeller Tool or Spin Tools), then you can still get into the WiFi run menu by pressing the reset button 3 times.
BTW @JonnyMac ... who's the Cafe Babe ?
I think the kit should have included the 74HC165 to show how to interface the 5 position switch to it and be able to use SPI to read it.
Mike
Neat idea.
Do you have a wiring diagram and code to share? We could feature it somehow.
$DEAD_BEEF is not in the holiday spirit! (unless it's roast, and served with mashed potatoes).
Here's a connection diagram for a '165 from a P1 product I designed sometime back.
You don't need the 4.7K if powering the '165 with 3.3v.
In your setup code, configure the IOs used by the '165
You can read 8 bits from the device like this:
In my particular case I have two 165s that are daisy-chained and the 9th bit from a DMX switch (17 bits total). The read code look this. It is unrolled for best speed because this runs in one of those 1ms background loops I mentioned in my first post.