Week15 Interface and Application Programming

write an application that interfaces with an input and/or output device

Network 'n interfaces

Using Processing

For that week assignment I choose to create an interface to call data front the bus network that I “fab” during the network and communication week. The interface architecture works has the picture below.

Sending data

By passing the mouse on the virtual representation of the board a message has sent to the bus with the board corresponding number. To that message each board respond by using the RGB LED break board (design in output device): with a RED blink but the one “ called” that starts fading in trow withe an blue until next sent message wen it will fade out.

Reading data

Once called the board starts sending the data from the light sensor integrated in each board. Data coming back to the interface “animating” the corresponding virtual representation of the board.

Embedded programing

First of all I had tho re- program the bus's boards. Starting from the Niel's C programs Hello.light.45.c and Hello.bus.45.c I adapt them for attiny44 ( Hello.light.44_me, Hello.bus.44_me) and I mixed them in order to have a specific sensor responding to a call. Than using has reference the Hello.RGB.45.c I played with the RGB LED to create the colors code of responding boards.
Taking care of the right correspondence of LED colors and pins.
The LED is responding well, sensors are giving me some troubles.

Interface programing

I create the first interface with Processing. Starting from the Topic example of fractal tree I made it responsive to sensor data by exchange the mouse position variable ( mouseX) with the serial reading data coming from the light sensor. I spent a bit long time to find the correct way to map those data. Apart the byte recompiling step that was already known from input devices week and applied. I found that the data coming back from my Darlington are inverted from expected. Are growing in absence of light. I learn that multiply for -1, has I was use to do in theory, doesn't work. And I found (thanks to Jani) that divide the maximum value expected from the sensor to the value incoming is a good way to obtain a nice effect for fractal growing plants.
Than I duplicate the trees ( one each board) and I made the mouse responsive. Starting from stick they transform in plants with mouse passing by, and call the corresponding board by click.
By clicking the corresponding plant the boards respond with a red LED but the one called that starts turning with and blue until another board is called.
The interface starts reading data from the board waking up the corresponding plant that stay closed in the dark and opening to the light until dry with to much sun.

Learning from friendly bugs: grasshopper+firefly experience.

arduino has Input device

arduino has Output device

warning virus attack!

Than a virus attack stops my investigation for the moment.

dowload file:processing_firefly_