initial commit

This commit is contained in:
2018-08-08 08:33:26 +02:00
commit ada8fdbdf9
368 changed files with 65878 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
/*
Into Robotics
*/
const int lowerThreshold = 250;
const int upperThreshold = 450;
const uint8_t analogPin = A0;
void setup()
{
Serial.begin(9600);
pinMode(analogPin, INPUT);
}
void loop() {
static bool state = LOW;
static unsigned int counter = 0;
int analogValue = analogRead(analogPin);
if (state == HIGH) {
if (analogValue < lowerThreshold) {
state = LOW;
counter++;
Serial.println(counter);
Serial.println("blykst");
}
} else { // state == LOW
if (analogValue > upperThreshold) {
state = HIGH;
}
}
}