You are on page 1of 2

Blink

void setup() { // initialize the digital pin as an output. pinMode(13, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

Blink PIN5 ON OFF 500ms

void setup() { // initialize the digital pin as an output. pinMode(5, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(5, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for a second digitalWrite(5, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a second }

Sensor

int sensorValue = 0;//integer with value 0 void setup() { Serial.begin(9600); } void loop() { sensorValue = analogRead (A0); Serial.println("sensorValue = "); Serial.println(sensorValue); delay(1000); }

You might also like