יציאות אנלוגיות PWM
RGB צבעי
RGB לד
Arduino סימולציה
ESP32 סימולציה
ESP32 ledc סימולציה
RGB קוד - לד
#define GREEN_LED 9
#define BLUE_LED 10
#define RED_LED 11
void setup()
{
pinMode(GREEN_LED, OUTPUT);
pinMode(BLUE_LED, OUTPUT);
pinMode(RED_LED, OUTPUT);
}
void loop()
{
rgb_color(0,0,255); //blue
delay(1000);
rgb_color(0,255,0); //green
delay(1000);
rgb_color(255,0,0); //red
delay(1000);
rgb_color(125,125,0); //yellow
delay(1000);
}
void rgb_color(int r, int g, int b)
{
analogWrite(RED_LED, r);
analogWrite(GREEN_LED, g);
analogWrite(BLUE_LED, b);
}
LED RGB analog
vicky.sigler
Created on November 5, 2022
Start designing with a free template
Discover more than 1500 professional designs like these:
View
Decisions and Behaviors in the Workplace
View
Tangram Game
View
Process Flow: Corporate Recruitment
View
Weekly Corporate Challenge
View
Wellbeing and Healthy Routines
View
Match the Verbs in Spanish: Present and Past
View
Planets Sorting Game
Explore all templates
Transcript
יציאות אנלוגיות PWM
RGB צבעי
RGB לד
Arduino סימולציה
ESP32 סימולציה
ESP32 ledc סימולציה
RGB קוד - לד
#define GREEN_LED 9 #define BLUE_LED 10 #define RED_LED 11 void setup() { pinMode(GREEN_LED, OUTPUT); pinMode(BLUE_LED, OUTPUT); pinMode(RED_LED, OUTPUT); } void loop() { rgb_color(0,0,255); //blue delay(1000); rgb_color(0,255,0); //green delay(1000); rgb_color(255,0,0); //red delay(1000); rgb_color(125,125,0); //yellow delay(1000); } void rgb_color(int r, int g, int b) { analogWrite(RED_LED, r); analogWrite(GREEN_LED, g); analogWrite(BLUE_LED, b); }