EP1001

Interfacing Apps

Arduino and Processing

Coding is Really not my strength, so I have opted to use abit of preset code to achieve this, which will be linked below. This will use a bit of software
called Processing in conjunction with with Arduino IDE to allow for computer input to trigger something on your microcontroller,
or for the opposite were sensor data on your microcontroller can be fed back to your computer for some user interfacing.

PhysicalPixel Code for Arduino-Processing

-Insert photo here-

Be sure to include SoftwareSerial.h, and define your rx and tx pins. This set up on mine allows me to use a serial cable without
the need to flip the rx and tx pins around.

-Insert photo here-

And be sure to change all Serial commands to mySerial. This highlighted command declares the Serial line.

-Insert photo here-

mySerial.begin helps start a serial channel to the attiny85. Serial.Begin will not work as
apparently that is just a preset operation for Arduino devices, which ours is not.

-Insert photo here-

This line checks the serial channel for any incoming data at all.

-Insert photo here-

This here scans the serial channel for any incoming data, and reads the most recent one.

-Insert photo here-

What this bit of code does is wait for a H on the serial channel, and set the LED on the board to High.

-Insert photo here-

And if it gets an L on the serial channel, it sets the LED back to Low.

-Insert photo here-

On the right, we have processing. Import the processing.serial library

-Insert photo here-

This line tests whether the mouse cursor is over a defined box on screen, if it is, draw a highlight around that box,
and send a H down the serial channel to be picked up by arduino IDE.

-Insert photo here-

If not, this line will send an L down the serial channel, and return the box to what it looks like by default.

-Insert photo here-

Then wiring it up to my Laptop, you can see when I move my mouse over the box, it lights up the LED

-Insert photo here-

And when I moved my mouse away, the LED turns off.

-Insert photo here-

I chose not to spend too much time on this section, as I would need to cannibalise this hello board for the Final Project.

Homepage

Electronics Production

Electronics Design

Embedded Programming

2D CNC Machining

3D CNC Machining

Moulding and Casting

Interfacing & Applications Programming

Final Project