Documentation 02

//Labs Digital Input & Output

Program the Arduino and lighting the two LEDs seperately using the switch.
    At first the one of the LED light did not light up. After checking, I noticed the cathode and anode of the LED was pluged in a reversed way so I corrected it and it worked.

video 2.1. lab digital input and output using an arduino

// Lab:  Analogue Input & Output using an Arduino

Add a potentiometor and LED
I added the potentiomter and the LED correctly. Initially the LED light does not have a gradual change but only appears like it did in the digital lab. I checked with everything and found it was because the potentiometer is not tightly connected with the breadboard. I changed a potentiometer and it worked.

video 2.2 (left). analogue input and output: a potentiometer and LED
video 2.3 (right). reading the serial monitor


Find the sensor range
then I tried with using the two sensors without soldering. I connected the right and left sensors reversely towards the analog pins so they controlled the right and left LED reversely.

video 2.4. sensors and LEDs

I noticed the video did not record the part the green LED is lighten up by the other sensor. It works but my hand covered it. But you can see that it actually works from the serial monitor.

video 2.5. reading the serial monitor

fig 2.1 & 2.2: showing the left and right sensor values when pressed separately

//Lab: Sensor change detection


Program the Microcontroller to Read the Pushbutton’s State Change

video 2.6. button state change
Count the button pressed times

video 2.7. button pressed times

Long press, short press, tap
Have a vague impression and understanding of the code: i know how it works but I may not be able to write it by myself.

video 2.8. long press, short press, tap

Program the microcontroller to test the sensor threshold crossing

video 2.9 sensor crossed the threshold

Detecting the peak value

video 2.10 detecting peak value

Dealing with noise
Still don’t understand the two lines of if()

video 2.11 dealing with noise

Questions after doing the lab:
1. For the potentiometer serial monitor one, why is brightness = analgueValue /4? why 4?
2. what does “long holdTime = millis() - pressTime” mean?  what does “long” represent, and how is it different from “int”?

Questions after reading the materials:
3. what does physical pin 12 do?
4. what does clock do for a microcontroller?
5. What’s the difference between synchronous and asynchronous serial?
6. where is IORef located?
7. what does the unit “bit” stand for? what is the difference between 32-bit and 8-bit?
8. Can you explain a little bit more on how PWM works to create a pseudo voltage enabling the analogWrite() to work?

Questions for the reading:
9. what are the limits of HCD? Does it overvalue the position of human and ignores other beings, being trapped in the dilema of the Anthroprocene?

notes taken at class {google doc}