/* | |
WARMER COOLER GAME | |
Use a ping sensor to determine distance and then depending on the distance, | |
show warmer or cooler colours. | |
Built using a ping))) Sensor and connected to a RGB display. | |
Uses the ping))) example in the base Arduino install, written by David Mellis & Tom Igoe | |
http://www.arduino.cc/en/Tutorial/Ping |
# Twitter stream analyser and serial activator (TSASA) | |
# | |
# This script analyses a twitter stream for keywords using the twitter | |
# streaming api - off the back of it, it then makes a serial request passing | |
# the message across to the serial device | |
# | |
# This was done fopr LCA2012 as an extension to the more code generator that | |
# Luke Weston build for the LeoStick | |
# | |
# |
Note: This is a bit of a scratch to see what's involved in getting the ping sensor to work as an I2C backpack.
- Jeff Hoeffs [http://github.com/soundanalogous](Sound Analogous) for guidance on using interrupts to do the time measurement on the ATTINY and [https://gist.github.com/soundanalogous/e94c6ebbc457b98b8383](providing a good example to work from)
- [http://github.com/rwaldron](Rick Waldron) for support of the backpack idea and keeping me moving. ;)
Controlling your nodebot using a USB cable is great and all, and obviously you could shell out and grab a sparkcore or some other dedicated controller but what if you've got a standard arduino and you want to take an existing nodebot wireless?
Bluetooth is an option and there's this excellent JohnnyFive wiki entry that will help you there. Bluetooth can be a bit flaky though and it's range is pretty lousy. You can also look at things like XBees and what not using point to point serial, but these are expensive and very fiddly to get working.
Really, what we want is a method of transferring data over a nice, simple, standard method, requiring little configuration, low cost and we can utilise a whole stack of the code we've already produced.
Enter the WiFi232 module. These little beauties are [available from AliExpress for $12 each](http://www.aliexpress.com/item/USR-WIFI232-T-wifi-to-uart-tt
This started from a chat in the [https://gitter.im/rwaldron/johnny-five](Johnny Five Gitter) and I thought I'd put some notes together because this comes up relatively often as people run into the terminology confusion that is caused by the Servo Manufacturers adopting the term PWM and it's usage amongst the Arduino community in relation to analogWrite().
This is my attempt at an explanation so if I've made any mistakes then please PR and we can make this better for everyone.
Servo is generally served by PWM support, right?
Sort of - PWM is typically a reference to an on/off duty cycle time - if I set my duty cycle to 50% then my pulses are on for 50% of the time and off for 50% of the time. If it's 10% then it's on 10% of the time, off 90%.
# Author: Andrew Fisher | |
# Version: 0.1 | |
# Date: 30/05/2012 | |
# Licence: BSD | |
# This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that | |
# has been converted to 565 format. This was highly useful when I was playing with some Arduino | |
# stuff requiring 16 bit LCD designs and couldn't remember the hex layout. | |
def rgb_hex565(red, green, blue): |
alias fritzing='~/fritzing/fritzing-0.8.0b.linux.AMD64/Fritzing' | |
alias avahi='avahi-browse --all' |
Note: These are rough notes and there may be some variance as versions of raspbian get updated but should be pretty reliable as a guide.
This gist provides some instructions and config in order to have your Raspberry PI automatically connect to a roamed network, however if it fails to discover an available network it will set itself up as a wireless access point for you to connect to.