Networking

For this week i started off my making an I2C wired network. It's very efficient in terms of wiring (only two wires to support many slaves), and a bonus of this protocol is that there are supported libraries that work with Attiny.

There are quite a few previous makers that have used tinywires, and their websites were very useful for me this week - in particular Loes Bogers

I installed libraries from this Arduino playgroud. The lastest tinywires is integrated slave and master, which i was able to install on the Attiny45, however there are problems in printing to serial and running tinywires at the same time. Instead - i foud it was better to stick to the old versions which split slave and master into tinywiresM.h and tinywiresS.h

This board uses the Attiny45, and therefore has very low pin counts. Some of the pins double up as both MOSI and clock lines and data lines - and therefore it is important to disconeect these signal pins when programming the board (see bellow).

Master Code

Slave Code

One note here - Tinywires sends infomation in single bytes, and so I remapped the values from my potentiometer to 1-255.