RobotikaWall
Add message
Add a new message
Title
Text
[code] #include "LearningKit.h" void setup() { Serial.begin(115200); setupRgbLed(); setupLeds(); setupButtons(); ledcSetup(1, 1000, 10); // ledcSetup(channel, freq, resolution) // resolution = 10 => 2^10 => 1024 ledcAttachPin(L_RGB_R, 1); } int state = 1; // 1 = up, -1 = down //bool state = 1; // 1 = up, 0 = down int light = 0; void loop() { light += state; //for(/*inicializace/*; /*podmínka*/; /*aktualizace řídící proměnné */) for(int i = 0; i < 1023; i++) { ledcWrite(1, i); delay(1); } ledcWrite(1, light); // ledcWrite(channel, value) // value => resolution = 1024 => value = 0 - 1023 delay(1); } [/code]
Password
Save