Instructions

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
int potpin=0; // Initialises analog Pin 0
int ledpin=11; // Initialises digital Pin 11
// output which regulates the led brightness
int val=0; // Initialises Variable Val
void setup() {
pinMode(ledpin,OUTPUT); // Set Pin 11 to output
Serial.begin(9600); // Set Baudrate to „9600“
}
void loop() {
val=analogRead(potpin);
// reads the sensors values and assigns it to val
Serial.println(val); // shows the values of val
analogWrite(ledpin,val); // turns on the led and sets the brightness
delay(10); // Waits 0,01 Seconds
}
220 Ω
10 kΩ