Serial Communications and Command Processing
After learning about the wonderful handling of interrupts that the ARM Cortex processors sport, I went right after it, setting up interrupt handling of serial communications, effects processing, and command processing. Let us set aside the first two and dive into command processing.
After all, what fun would it be if we had all these LED effects and patterns set in the Teensy 3.1 and have no way to tweak them, or trigger them, other than to loop through them with a fixed timer of some sort? No fun at all I think. I mean, sure! They will look stunning as they fade from green to red, sparkle with fade effects. But unless they are linked to something, like music, or a movie clip, they are just effects running a set script that has no life at all.
So, we established serial communications with the blue tooth, and my laptop, but unless I plan to sit by the door and manually trigger the effects with the laptop, I need a way to send commands to the effects processor (currently the Teensy 3.1) from another controller, that makes decisions based on numerous input conditions.
The Teensy 3.1 can handle all of that on its own I'm sure, but this isn't about efficiency. It's about performance, breaking out all the tech I have available. I can downscale later. Right now, let's add whatever we need to get the job done!
So we need a command processor. A way to interpret commands from another controller, act on those commands with parameters, and offer feedback through the same communications link.
This offered a mix of issues, most of which attributed to my rusty experience with dealing with strings in C and C++. I broke all the rules here, but I got what I needed. The ability to send a command, have that realized and pushed onto a command stack, pulled at will and processed, rinse and repeat. The only annoying issue is that I have a carriage return character that seems to appear before every entered command. Using the replaced Teensy 3.0 to send automated commands to the project will hopefully fix this issue.
And that is where I am at right now. I have both Teensy's bread boarded and ready to test. Once I get past this hurdle, it will be time to work on the LED effects processor. And that will be the next post.
STAY TUNED!
More when I code it...



