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?
The Hannah has a lot of IO, and hence most of it is attached to an I2C IO expander (including the tricolor LED).
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:
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