SVANUR KRISTJANSSON

Projects

HTML tutorial

Interface And Application Programming


Assignment: Write an application that interfaces with an input &/or output device that you made, comparing as many tool options as possible.

We use the Hello World board with button and LED from Embedded programming week.

We begin by greating a new Arduino file and also opening the SoftwareSerialExample file. We type #include and copy the line SoftwareSerial mySerial(10, 11); // RX, TX and change it to SoftwareSerial mySerial(0, 1); // RX, TX.

We then copy the line mySerial.begin(4800); and change the baud rate to 115200 and activate the pullup resistor on the button pin.

We open a file from Embedded programming week that already has the button/pin allocation relevant to my board and copy that across.

For the main code, we make the LED turn on when the letter L is pressed and turn off when the letter l is pressed, and to send back the code for the letter b if the button is not pressed, and the letter B if it is pressed.

Now we open Neil Gershenfeld's motion detector .py code and modify it to show the word Pressed when pressing the button and the word Released when not pressing it. We also have to change the baud rate in line 52 in the .py code to 115200.

Enjoy the show.

Interface.ino

interface.py