Update light_fast.ino

shuld work
This commit is contained in:
i3le 2024-07-11 19:22:35 +02:00
parent b37183d1dd
commit 7b989cea31

View file

@ -55,13 +55,16 @@ void movement(){
else{
movement_threshold = 80;
}
if (movement_threshold-25 > 0){
mySerial.write(movement_threshold-25);
Serial.print("Msg Send:");
Serial.println(movement_threshold-25);
}
sendnetsteck(-25);
}
void sendnetsteck(int8_t livx){
if (movement_threshold-livx > 0){
mySerial.write(movement_threshold-livx);
Serial.print("Msg Send:");
Serial.println(movement_threshold-livx);
}
}
void setup() {
delay(random(0, 20));
pinMode(Move_sensor,INPUT);
@ -120,7 +123,10 @@ void loop() {
uint8_t msg = mySerial.read();
Serial.println(msg);
if (msg < 101){
if ( msg >= movement_threshold ) movement_threshold= msg;
if ( msg >= movement_threshold ){
movement_threshold= msg;
sendnetsteck(-25);
}
}
}