Browse Source

Dateien in sketch ordner verschoben

master
Johannes Krug 5 years ago
parent
commit
456cf4f69b
1 changed files with 21 additions and 0 deletions
  1. 21
    0
      arduino/analog_signal_output/analog_signal_output.ino

+ 21
- 0
arduino/analog_signal_output/analog_signal_output.ino View File

//analoger ausgang gibt nur den aktuellen wert des potis aus, also nur zum genauen poti einstellen geeignet! ansonsten nutzlos


int sensorPin = A0; // select the input pin for the potentiometer
int ledPin = D0; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

void setup()
{
pinMode(ledPin,OUTPUT);
Serial.begin(9600);
}
void loop(){
sensorValue = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorValue);
digitalWrite(ledPin, LOW);
delay(sensorValue);
Serial.println(sensorValue, DEC);
}


Loading…
Cancel
Save