Week 16_Interface and application programming

Assignment

individual assignment:
write an application that interfaces with an input &/or output device
that you made
group assignment:
compare as many tool options as possible

Individual assignment

Processing

Below are some references


Sketch 1

Based on the Sparkfun tutorial I have tested the connection between Processing and Arduino

all

When I press the mouse button inside the processing box ,the led on my board will turn on and when I press again it will turn off


Sketch 2

Now I will test a simple serial connection with the ldr value of my previous Board B1

all
my board ldr

Code explanation:
In Arduino code the ldr value is checked , if the value is higher than 500 than it will send 1 on the serial if not it will send 0
In Processing software the code reads the value received on the serial and if it is equal to 0 than it will draw a rectangle with black color "fill (0)" if else it will change the color to grey "fill (204)"


After that I have made some adjustments in the code and changed the size of the display from 200x200 to 400x400 and change the rectangle to circle.

all

After that I have changed the background color and added a text showing the received values

all all

Sketch 3

Now I will test another simple serial connection with a Potentiometer connected to my Board B1

pot
my board pot

Sketch 4

Now I will control the Led on Pin13 with the Potentiometer connected to my Board B1

pot

The background color will change with the potentiometer value and the led is controlled by the mouse buttons: left click will turn on the led and the right-click will turn off the led.


Group Assignment:

Compare as many tool options as possible

Check Berytech page for the Group Assignment

As from my side I tried the MIT APP INVENTOR

I will connect through bluetooth to turn on and off the led light and the fan of my final project

app1

To turn on the led it will send 1 via the appliction and to turn off the led it will send 0

To turn on the fan it will send A via the appliction and to turn off the fan it will send B

app2

After that I will press on build to generate the application.

app3 app4

I will receive a QRCODE to read via my phone to install the application.

app5

And this is the code used for testing

code

Files

Click Here to download the Processing Sketch 2

Click Here to download the Arduino Sketch 2

Click Here to download the Processing Sketch 3

Click Here to download the Arduino Sketch 3

Click Here to download the Processing Sketch 4

Click Here to download the Arduino Sketch 4


Click Here to download the mit-app-inventor Bluetooth Code

Click Here to download the Phone App

<Prev - Next>