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

Post on 11-Mar-2018

214 views 1 download

transcript

Verkabelung mit LED

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

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

LED DIMMEN

Verkabelung von dem Infrarotsensor

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

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); }

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