2015年2月13日 星期五

In this lesson, we will first use the speaker and try to connect with the battery and coins. It may release different kinds of sound.




 We used the light sensor to detect the light and make the speaker make some sound.
We need to write down the largest and the smallest number in the serial port to determine the light hitting the sensor.

Here is the process:

2015年2月10日 星期二

Week 3 ( PING sensor/ LCD sensor)


In this lesson, we continued to use different sensor to produce different output.

PING Sensor

We first connect the PING sensor by the hardware setup:

  • connect the SIGNAL pin on the Ping))) to pin D7 on our Arduino.
  • 5V output from Arduino to 5V input of the sensor and GROUND to GROUND. 

After we have connected the PING sensor with the Arduino, actually we can listen a little sound which released by the PING sensor. I guess it is because of the echo around the sensor? and the pulse which released by the Arduino and the second pulse by the PING sensor. 

We are then need to make a LED turn on and the distance should be less than 10 cm by using the sensor with the resistor. We have learnt a new code language which is represent "less than" in the coding which is <. We also need to use the If statement to represent if the distance between the object and the PING sensor is less than 10 cm. 



 When we put the hand near the sensor by no more than 10 cm, the LED will turn on. If the hand is near the sensor more than 10 cm, the LED will not turn on.

Serial LCD


Lastly, we have used the serial LCD to display the texts or numbers which can type by ourselves. We just used the sample code and change the words inside the code so that it can display "Hello World!". 




2015年2月6日 星期五

Week3

In this lesson, we started to connect the Arduino with USB to the computer and do various tasks.

First of all, we try to make LED light on (Digital Out) through we connect the Arduino with the computer.




Then we used the switch to control the LED on or off which is Digital In.


Tilt Sensor


We first use the sample code to feel the two direction when I move and tilt the sensor. 
Actually the tilt sensor sense four direction in the Arduino. We rewrite the code and make the tilt sensor can sense four direction when I move the Arduino which are top, left, right and bottom. 

Actually this may waste us some time to think about how to rewrite this code by using the if function.  We need to calculate different situation such as top which means vol1 equal to 1 and vol2 equal to 0.