SCRATCH control for MOD-IO


Image

Controlling Relays, Switching ON/OFF of 220V appliances and home automation is possible now with Scratch + MOD-IO.

1. Install python-smbus:

#apt-get install python-smbus
2. Install scratchpy

#git clone https://github.com/pilliq/scratchpy.git
#cd scratchpy
#make install

3. Run SCRATCH and open MOD-IO.sb

4. Go to ‘Sensing’. Right click ‘… sensor value’ hit: ‘Enable
remote sensor connections’ (if it not enabled).

5. Run terminal and start the python script
#python IO.py -a 0x58 -i 2 --host=xxx.xxx.xxx.xxx --port=xxxx --verbose
-i - I2C bus that you're using
-a - Address of MOD-IO (default 0x58)
--host - IP if you're connecting remote computer
--port - Port number
--verbose - Print some debug information.
For example:
#python IO.py -a 0x58 -i 2 --verbose --host=192.168.0.100 --port=40000

You should see message that the program is connected.

6. Run the Scratch block

7. Press ‘1’, ‘2’, ‘3’ or ‘4’ to toggle relays

the project is uploaded on GitHub: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/A13%2BSCRATCH%2BMOD-IO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: