Oj lenistwo wysokich lotów
Kod:
byte state = 0;
void setup() {
Serial.begin(9600);
pinMode(9,OUTPUT);
pinMode(2,INPUT);
}
void loop() {
if ( digitalRead(2) == LOW and state == 0){
for (int x=0;x<255;x++){
analogWrite(9,x);
delay(2);
Serial.println(x);}
state = 1;
}
if ( digitalRead(2) == HIGH and state == 1 ){
for (int x=255;x>=0;x--){
analogWrite(9,x);
delay(2);
Serial.println(x);}
state = 0;
}
}
Ważne aby robić co się lubi albo lubić co się robi .
Arduino UNO, TINY, PRO MINI
Pomoc nagradzamy punktami reputacji
Arduino UNO, TINY, PRO MINI
Pomoc nagradzamy punktami reputacji