+ All Categories
Home > Documents > · Web viewSerial.println(time); // wait a second so as not to send massive amounts of data...

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

Date post: 11-Mar-2018
Category:
Upload: duongduong
View: 214 times
Download: 1 times
Share this document with a friend
5
Verkabelung mit LED
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)


Recommended