For my tank project I needed a failsafe should my serial radio link crap out on me, and as I had a standard RC transmitter lying around, it seemed natural to use it. After doing a bit of reading and prototyping, I managed to come up with a fast, non-blocking method of capturing the RC signals and converting them into a usable value.
Continue reading Capturing servo RC PWM signals with a Teensy 3.1
Category: Programming
Anything to do with programming, could be PHP, Python, Javascript, HTML, CSS, Java, Bash etc.
Software reset Teensy 3.1
For my tank project it was useful to be able to sense when a reset signal is sent and restart the Teensy via software. A quick google later and I found this post by kam42, which describes a macro which does exactly what I needed.
For the sake of completeness, heres a full sketch that would reset every 5 seconds. Don’t do this as I doubt constantly restarting is particularly healthy for the chip.
[c]
#define CPU_RESTART_ADDR (uint32_t *)0xE000ED0C
#define CPU_RESTART_VAL 0x5FA0004
#define CPU_RESTART (*CPU_RESTART_ADDR = CPU_RESTART_VAL);
void setup() {
}
void loop() {
CPU_RESTART
delay(5000);
}
[/c]
This will break the USB serial connection, so your serial monitor will fail, and you’ll have to reconnect.
Sofa LEDs
While on a 48 hour long drink/blackout, the idea was posed that the sofa should have under lighting. Seemed like a reasonable request. With the installation of a projector, the room had to be kept as dark as possible. A few dented shins and it was evident that some kind of low-level lighting was required. Jump to having 2 large pieces of MDF cut to 10mm narrower to the sofa outline and we’re half way to victory. Looking through Ebay it was easy to find LED strips that would be sufficient to wrap around the perimeter of the MDF; it was just a matter of controlling the colours.