Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Arduino-Programm zum Paketzustellungsdetektor
/*
Paketzustellungsdetektor
MobileGeeks DIY
Matthias Lindholm
http://mobilegeeks.de/diy
*/
#define FSR_GRENZWERT 15
#define ONBOARD_LED 13
#define FORCE_SENSOR 0
int force_value = 0;
byte force_state = 0;
void setup() {
Serial.begin(9600);
pinMode(ONBOARD_LED, OUTPUT);
}
void loop() {
delay(1000);
force_value = analogRead(FORCE_SENSOR);
switch (force_state){
case 0:
if (force_value >= FSR_GRENZWERT)
{
force_state = 1;
digitalWrite(ONBOARD_LED, HIGH);
Serial.print("Paket abgelegt");
}
break;
case 1:
if (force_value < FSR_GRENZWERT)
{
force_state = 0;
digitalWrite(ONBOARD_LED, LOW);
Serial.print("Paket aufgenommen");
}
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.