· web viewserial.println(time); // wait a second so as not to send massive amounts of data...

5
Verkabelung mit LED

Upload: duongduong

Post on 11-Mar-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data delay(1000); } Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange) Created

Verkabelung mit LED

Page 2: · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data delay(1000); } Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange) Created

Die beiden Methoden im ProgrammcodeÜbersicht BeispielprogrammBeispiel: LEDHIGH-> LED ist anLOW-> LED ist aus

Konstantenconst-> wird sich nicht ändernBeispiel: const int ledPin=13

Page 3: · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data delay(1000); } Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange) Created

LED DIMMEN

Verkabelung von dem Infrarotsensor

Weisses Kabel-> analogen Pin (z.B. A0)Schwarzes Kabel-> GNDRotes Kabel-> 5V

Page 4: · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data delay(1000); } Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange) Created

Interne Stoppuhr

millis()* Mit rückgabewert* Gibt die Zeit an wie lange das Programm durchlaufen ist.*

Beispiel: unsigned long time;

void setup(){ Serial.begin(9600);}void loop(){ Serial.print("Time: "); time = millis(); //prints time since program started Serial.println(time); // wait a second so as not to send massive amounts of data delay(1000); }

Page 5: · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data delay(1000); } Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange) Created

Verkabelung vom Servo (bei unserem Servo ist das gelbe Kabel orange)