WEEK SIXTEEN
-Interface and application programming-
ASSIGMENT; Write an application that interfaces with an input &/or output device that you made, comparing as many tool options as possible
So what I wanted to do is to use the button pin of the Input device week and when you press the botton you see the image and when you do not press it you see a black image.
Once I had clear what I wanted to do I just follow the power point slides that Taco shared with us in order to connect arduino with processing. I download and Install the Control IP5 library.
Then I have include the three following libraries in my Processing sketch
Then specify which is the port of the device I want to program the programmer.
This is the code in Arduino. Important things are: First define the pins RX (reciver) and TX (transmiter) so I check the squematic.And then deine the input pin (switch/botton) in my case number 3. Then I create communication with the softwareserial command. And then I specify the speed at 9600. In the void loop I specify how I want the pins to work so I use IF and ELSE command saying when I press one it appears something and when I do not press it it appears another thing.
To program the code I connect the programmer to the computer and detect with the guit if it detects it. And after it I just click the UPLOAD button in Arduino to program it.
Once it is programed it I connect the FTDI cable t read what it does the board and to do so I just have to click in the serial monitor button.
And then just interact with the button to see changes.
So I open Processing and what I want to do is use the button as an INPUT pin and when you press the botton you see the image and when you do not press it you see a black image.
So this is the code. Immportant things:First I type the libraries I will use that I downloaded and also I specify the two resoults when interacting with the button. In my case an image when pressing the button and a background color when not pressing it.
The serial communication is infinite and wiht this command we say that if something goes wrong we will pick the O.The LF means that we read until we fuound an enter. And the delay command is the time.
Files
Arduino-code