Software auf HW angepasst, Pin geschaltet ergibt LOW in CPU und umgekehrt,

Fehlerchen entfernt.
This commit is contained in:
sven 2021-04-12 21:42:08 +02:00
parent 8e847d9c3b
commit f792080b8c

View file

@ -158,8 +158,8 @@ void loop() {
} }
unsigned long currentMillisEti = millis(); unsigned long currentMillisEti = millis();
Motor = MotorDelay * 100; Motor = MotorDelay * 20;
if (digitalRead(11) == HIGH && run == 0 && finish == 1){ if (digitalRead(11) == LOW && run == 0 && finish == 1){
run = 1; run = 1;
finish = 0; finish = 0;
} }
@ -167,8 +167,8 @@ void loop() {
digitalWrite(12, HIGH); digitalWrite(12, HIGH);
if (digitalRead(7) == HIGH){ if (digitalRead(7) == HIGH){
gapDetected = 1; gapDetected = 1;
} }
if(gapDetected = 1) { if(gapDetected == 1) {
if (currentMillisEti - previousMillisEti >= Motor) { if (currentMillisEti - previousMillisEti >= Motor) {
previousMillisEti = currentMillisEti; previousMillisEti = currentMillisEti;
run = 0; run = 0;
@ -182,14 +182,16 @@ void loop() {
digitalWrite(12, LOW); digitalWrite(12, LOW);
previousMillisEti = currentMillisEti; previousMillisEti = currentMillisEti;
} }
if (run == 0 && digitalRead(11) == 0){ if (run == 0 && digitalRead(11) == HIGH){
finish = 1; finish = 1;
gapDetected = 0;
} }
UP_OLD = UP; UP_OLD = UP;
DOWN_OLD = DOWN; DOWN_OLD = DOWN;
ENTER_OLD = ENTER; ENTER_OLD = ENTER;
} }
void testdrawbitmap(void) { void testdrawbitmap(void) {