งานที่14
หรี่ความสว่างหลอดไฟ LED ด้วย Arduino ให้ลดแสงสว่างและประหยัดพลังงาน

| const int analogOutPin = 3; //กำหนดใช้งานขา 3 ของ Arduino | |
| void setup() { | |
| } | |
| void loop() { | |
| analogWrite(analogOutPin, 255); //เลขสีแดงเราสามารถกำหนดค่าที่ต้องการได้ 0-255 | |
| } |

| const int analogOutPin = 3; //กำหนดใช้งานขา 3 ของ Arduino | |
| void setup() { | |
| } | |
| void loop() { | |
| analogWrite(analogOutPin, 255); //เลขสีแดงเราสามารถกำหนดค่าที่ต้องการได้ 0-255 | |
| } |
ความคิดเห็น
แสดงความคิดเห็น