Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

analog_signal_output.ino 621B

1234567891011121314151617181920212223
  1. //www.elegoo.com
  2. //2016.12.9
  3. //analoger ausgang gibt nur den aktuellen wert des potis aus, also nur zum genauen poti einstellen geeignet! ansonsten nutzlos
  4. int sensorPin = A0; // select the input pin for the potentiometer
  5. int ledPin = D0; // select the pin for the LED
  6. int sensorValue = 0; // variable to store the value coming from the sensor
  7. void setup()
  8. {
  9. pinMode(ledPin,OUTPUT);
  10. Serial.begin(9600);
  11. }
  12. void loop(){
  13. sensorValue = analogRead(sensorPin);
  14. digitalWrite(ledPin, HIGH);
  15. delay(sensorValue);
  16. digitalWrite(ledPin, LOW);
  17. delay(sensorValue);
  18. Serial.println(sensorValue, DEC);
  19. }