Week 8 - Journal
IDEA
The idea for this week is to use Processing to create GUI to display dynamic information (text) from temperature sensor and using toggle button to allow user to power on a led lamp. This idea is applied through connecting processing software with arduino.
WHAT IT MAKES?
1- Sense Temperature
2- Display Temperature to user on PC (Graphical User Interface)
3- Controls a Led to power on/off through Arduino and Toggle button
REFERENCE PROJECTS
Reference project link:
https://drive.google.com/file/d/1IGFkBFCpScSUJiRswQKbX9AWXfgjgwP6/view
and code Library https://docs.google.com/presentation/d/16bqFVt59H3HI3eoQlzMSN5PPCc_34xRUPl7exkBnp2M/present?slide=id.g9cb6083280_0_31
USED COMPONENTS AND SOFTWARES
Components:
Arduino Uno
Jumpers (male / female)
Breadboard
USB to a mini USB cable
Red Led
220 ohm resistor
Temperature sensor Lm35
Push Button
Softwares:
I used Tinker Cad Website for simulation and Circuit Diagram and Arduino IDE TO Design / Write the code and Transfer the code to the Arduino Uno
Processing Software to create the graphical user interface.
DESIGN AND IMPLEMENTATION PROCESS
1- I started by watching video tutorials in week 8 first for controlling led through push button, then through serial monitor in arduino and finally through graphical user interface in processing software.
2- I made my wiring diagram on tinkercad
3- I implemented my wiring diagram with arduino uno, led light, temperature sensor, resistor 220 ohm, jumpersm push button
4- I started to build my code step by step and started to test it: first to control the lamp with push button, and then with serial monitor
5- I started to build the code on processing and install the needed libraries and complete my code
http://www.sojamo.de/libraries/controlP5/
6- Test my processing code and solving problems till i reached the desired result
Code
WHEN I GOT STUCK!
When I got stuck i used to return to the video tutorials in week 8 and i turned to my instructor for an error i got, the problem was in syntax. i go stuck again as nothing happened at first when running the code in processing and i revised my code again and found the problem in my last sentence. I should have written myPort.write('a'); _instead of_ println("Press');