Closed whaleygeek closed 10 years ago
This was tested by Jean Charpentier and proved to work on a UNO. You might want to change the #define MAX_PINS to account for less GPIO's on the UNO, although just don't use the higher numbers from python and all will be fine.
Here is Jean's youtube video proving it works:
For Anyio to work on any arduino platform, it requires you to program the anyio firmware into the arduino chip first. If you buy a pre-assembled anyio board from skpang.co.uk these are pre-programmed with the firmware. However, if you are using a bare Arduino Pro Micro, or other platforms, you need to first program the firmware into the board before it will communicate with the Python library.
To do that, open the Arduino IDE and configure the board type for the board you are using, and load this sketch into your IDE editor:
https://github.com/whaleygeek/anyio/blob/master/anyio/arduino/firmware/gpio/gpio.ino
Upload this to the Arduino. Then reset the Arduino board, run your python program and follow the port install instructions.
Note that not all Arduino's will support anyio - the trinket for example does not have a serial port emulation mode on it, so it cannot work with anyio. The anyio Python library uses an embedded version of the pyserial library to communicate with the anyio arduino firmware that you program, but assumes that the arduino can "present" it's serial port over the USB link, for this to work.
I have only tested anyio on a SparkFun Arduino Pro Micro 3.3V. I plan to test on other platforms. But if you have tried the above instructions and got them to work on other Arduino platforms, please let me know and I will make sure I update the README file to include them in the list of tested platforms.
I plan to test (soon) on an Arduino Uno, and an Arduino Pro, because both of these platforms are for sale in high street retail shop Maplin Electronics, which means you can go shopping on a Sunday in the UK and buy all the parts you need to get inventing with electronics!