Physcomp: week two
It is important to identify all pins on Arduino Nano 33 IOT. For output A0 or the 4th one on the left is to be used, 2nd on left for 3.3V power and 14th port for ground. And I made lots of mistake in coding with Arduino and why this code wont processing, and I learnt that it is very important to check the spealing, and double check the wires we connect.
Digital Input and Digital Output
One LED Without the Buttom
At start, I connect the basic parts and make a circuit with no other components, I couldnt find any read wires so I use white wires to connect for the positive.
After that I go straight to do the LED and coding. However, when I tried to run the code it shows error and indicates that the nano 33IoT plugin wasnt installed successful, so redownload everything.
︎︎︎one LED circuit and error coding
Then, the green LED I first put on wasnt light enough, so I thought there might be something with my circuit and the code, I double checked them for several times then it still shows nothing. So I thought it might because of the switch not working, so I did a Button State, it came out incorrent at first then I realized it because I connected the switch to the wrong side.
After check the button is working, I checked the other compoents, found out that its the LEDs problem so I changed for a white LED.
︎︎︎one LED circuit and correct coding
One LED With the Buttom
After this I added a switch to the circuit, samething happaned again on this one, so I did the same buttom state and double checked the coding and circuit.
︎︎︎one LED circuit with the switch and correct coding
Two LED With the Buttom
After this I added a switch and another LED to the circuit, same thing happaned again on this one, so I did the same buttom state for the two LED circuit and double checked the coding and circuit.
︎︎︎Two LED circuit and correct coding
Analog Input one
In the lab experiement we are using breadboard, Arduino, some jumper wires, resistors, force sensing resistor, thermister, and a potentiometer. And I connect the force sensing resistor, thermister and potentiometer in on circuit and did a state test.
︎︎︎the circuit and coding process
Sensor Change Detection
For this parts, we are learning when the digital input changes from LOW to HIGH or the reverse, we can tell that a person closed or opened a switch. When a force-sensing resistor reaches a peak reading, we know that something has hit the sensor.
Long Press and Short Press