Zalohy z 24. schuzky.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -120,8 +120,8 @@ void go_forward(unsigned char speed_val) // speed_val:0~255
|
|||||||
digitalWrite(pinRF,LOW);
|
digitalWrite(pinRF,LOW);
|
||||||
digitalWrite(pinLB,HIGH);
|
digitalWrite(pinLB,HIGH);
|
||||||
digitalWrite(pinLF,LOW);
|
digitalWrite(pinLF,LOW);
|
||||||
analogWrite(Lpwm_pin,speed_val+6);
|
analogWrite(Lpwm_pin,speed_val+5);
|
||||||
analogWrite(Rpwm_pin,speed_val+5);
|
analogWrite(Rpwm_pin,speed_val+8);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
int pinG = 13;
|
||||||
|
int pinY = 12;
|
||||||
|
int pinR = 11;
|
||||||
|
|
||||||
|
int pinB = 2;
|
||||||
|
|
||||||
|
int hodnota = HIGH;
|
||||||
|
const OFF = HIGH;
|
||||||
|
const ON = LOW;
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pinMode (pinG, OUTPUT);
|
||||||
|
pinMode (pinY, OUTPUT);
|
||||||
|
pinMode (pinR, OUTPUT);
|
||||||
|
|
||||||
|
pinMode (pinB, INPUT);
|
||||||
|
|
||||||
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop(){
|
||||||
|
hodnota = digitalRead(pinB);
|
||||||
|
Serial.println(hodnota);
|
||||||
|
if (hodnota == ON){
|
||||||
|
digitalWrite(pinG, HIGH);
|
||||||
|
delay(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user