6 –labaratoriya ishi
RGB-yorug‘lik diodi
Bajardi: Lolabekov Jaxongir
Tekshirdi: Arabboev Muxriddin
8 – variant
LEDred = 8 , LEDblue = 12 , LEDgreen = 10 , delay = 1200;
#define HRED 8
#define HBLUE 12
#define HGREEN 10
void setup(){
pinMode(HRED,OUTPUT);
pinMode(HBLUE,OUTPUT);
pinMode(HGREEN,OUTPUT);}
int r = 0;
int g = 0;
int b = 0;
void loop(){ r = random(0,255);
g = random(0,255);
b = random(0,255);
analogWrite(HRED,r);
analogWrite(HBLUE,g);
analogWrite(HGREEN,b); delay(1200);}
Do'stlaringiz bilan baham: |