Blink-O-Matic for Hannah

I’d like to toggle an external device (LED, fan, etc…) like the Blink-O-Matic example shows for the April board.  I’m struggling to understand how to accomplish the same thing with the Hannah board, though.  All the examples i’ve seen for the IoExpander control a component on the board through it’s address.  Is this even possible through the IoExpander, or should i be using something else on the Hannah to do this?


Thanks for the help,

Brad

The Hannah has a lot of IO, and hence most of it is attached to an I2C IO expander (including the tricolor LED).


However, if you want to do something in the blink-o-matic style (ie, just directly with an IO pin), then you could use pins 5 and 7, which are attached to the servo headers - this is the easiest way to access two direct pins on the imp.

Is there an example of using the alternate spares on the IoExpander for the Hanna similar to the April? Like the blink-o-matic.

To use the servo pins as I mentioned, just change the blink-o-matic code from hardware.pin9 to hardware.pin5 or hardware.pin7 (5 is the top pin on the “servo 1” connector, 7 is the top pin on the “servo 2” connector).

To use (eg) spare 11, you’d use the ioexpander class like this:

// Setup
io <- IoExpander(I2C_89, 0x3e);
io.setDir(11, 1); // set pin 11 as output

io.setPin(11, 0); // sets pin 11 low
io.setPin(11, 1); // sets pin 11 high

perfect thanks!