Presentation is loading. Please wait.

Presentation is loading. Please wait.

Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Analog Input/Output Chin-Shiuh Shieh ( 謝欽旭 ) Department of.

Similar presentations


Presentation on theme: "Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Analog Input/Output Chin-Shiuh Shieh ( 謝欽旭 ) Department of."— Presentation transcript:

1 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Analog Input/Output Chin-Shiuh Shieh ( 謝欽旭 ) http://bit.kuas.edu.tw/~csshieh Department of Electronic Engineering National Kaohsiung University of Applied Sciences, Taiwan

2 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan2 Analog Input/Output

3 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan3 Analog Input/Output (cont) pinMode(pin,mode); analogRead(pin);// [0,1023] analogWrite(pin,value); // Pulse Width Modulation (PWM), [0, 255] Analog-to-Digital Converter Digital-to-Analog Converter

4 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan4 Example – VR

5 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan5 Example – VR (cont) void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(A0)); }

6 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan6 Example DC Motor

7 Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan7 Example DC Motor (cont) void setup() { pinMode(2,OUTPUT); } void loop() { int vr=analogRead(A0); analogWrite(2,vr/4); delay(100); }


Download ppt "Autumn, 2014C.-S. Shieh, EC, KUAS, Taiwan1 智慧電子應用設計導論 (1/3) Analog Input/Output Chin-Shiuh Shieh ( 謝欽旭 ) Department of."

Similar presentations


Ads by Google