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 ?
Edit 2024.12.27.: Binary file removed as not sanctioned by the author. Please compile from the source code provided in previous post.
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.
Hi, I was stuck for a few minutes troubleshooting when I discovered the diagram doesn't show the correct WiFi module placement. See correction below.
/Users/marcusgarfunkel/Pictures/Photos Library.photoslibrary/resources/derivatives/3/39C8D57A-BB58-46E0-AE28-76C65128E3D1_1_105_c.jpeg
Thanks,
Marcus
Thanks Markus- will get that updated in the morning.
Edit: Updated 2024.12.26. - Product guide and .png image files all updated. Thanks to Marcus for spotting that overzealous orange box.
@VonSzarvas
Also, the buzzer isn't shown in the diagram
Thanks for the updates.
Ha! yeah, that part was missing on the breadboard making software. Here goes something!
Hi,
I tested the JonnyMac bin file uploaded via the web page. It does run, although it's not very usable in my current configuration. The app requires a console (terminal) port to access the menu. When I try to run the PIXEL patterns when connected to my PC (MacBook Air), it crashes, I assume due to lack of power available on the USB port. When I run it from the supplied USB Power brick, there's no way to access the serial terminal.
Thanks,
Marcus
I found the same- jons demo relies on terminal by default. Can you use a powered hub to boost the power?
Or adjust the code to use less “brightness” for each pixel? Jon has a colorx function in his library, as one way.
Ideally someone might have time to extend jons code to use the oled for the menu.
Relatedly… another option for more pixel power could be to add another 5v supply. In testing I used a Parallax powerpal as those are dirt cheap now, and breadboard friendly.
Too many options of course!!
I can't read minds to make code "usable" for every user's desires or configuration. What I can -- and do -- is provide baseline code that works from which you can take the pieces you need to build YOUR application. Note that I provided a source code archive, not a binary that you can't change.
The reason I wrote that baseline code using a USB terminal is that it takes a variable out of the equation (WiFi connection, which has been iffy on my end even with my WiFi router sitting five feet from my desk) so that focus is on lighting patterns (something Ken asked me for), and I chose to demonstrate how my embedded music/beeps/boops player works.
Jon- if there’s anything to do on the module side to make things less ‘iffy’ please let me know and will do my best to improve it.