หากต้องการใบเสนอราคา / ใบแจ้งหนี้ ติดต่อได้ทาง LINE Official: @mikroelec |
![]() |
รหัสสินค้า | SKU-02364 |
หมวดหมู่ | หลอด LED (LED LAMP) |
ราคา | 18.00 บาท |
สถานะสินค้า | พร้อมส่ง |
ลงสินค้า | 2 ก.ค. 2566 |
อัพเดทล่าสุด | 17 ก.พ. 2567 |
จำนวน | ชิ้น |
The following Arduino sketch will gradually increase/decrease the PWM values on the red, green and blue pins causing the LED to cycle through various colors.
int redpin = 11; // select the pin for the red LED
int bluepin =10; // select the pin for the blue LED
int greenpin =9; // select the pin for the green LED
int val;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(bluepin, OUTPUT);
pinMode(greenpin, OUTPUT);
Serial.begin(9600);
}
void loop() {
for(val = 255; val > 0; val--)
{
analogWrite(11, val);
analogWrite(10, 255 - val);
analogWrite(9, 128 - val);
Serial.println(val, DEC);
delay(5);
}
for(val = 0; val < 255; val++)
{
analogWrite(11, val);
analogWrite(10, 255 - val);
analogWrite(9, 128 - val);
Serial.println(val, DEC);
delay(5);
}
}
หน้าที่เข้าชม | 563,672 ครั้ง |
ผู้ชมทั้งหมด | 321,315 ครั้ง |
ร้านค้าอัพเดท | 19 ต.ค. 2568 |