ChatLog TACT - Internet of Things - 07 - 04 - 2018 2018 - 04 - 14 11 - 16

You might also like

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 1

Chat Log C:\Users\admin\Documents\ChatLog TACT __ Internet of Things _ 07_04_2018

2018_04_14 11_16.rtf

Shafi Patel (to All - Entire Audience): 8:37 AM: AC/DC


Shafi Patel (to All - Entire Audience): 9:41 AM: www.tinkercad.com
Shafi Patel (to All - Entire Audience): 9:43 AM: 15 Minutes break
Shafi Patel (to All - Entire Audience): 9:59 AM: Break is over.
Shafi Patel (to All - Entire Audience): 10:17 AM:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(10, OUTPUT);
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Shafi Patel (to All - Entire Audience): 10:41 AM: Vcc of Sensor - 5 V on Arduino
Shafi Patel (to All - Entire Audience): 10:41 AM: GND of sensor - GND on Arduino
Shafi Patel (to All - Entire Audience): 10:41 AM: OUT pin of sensor - pin 2 on Arduino
Shafi Patel (to All - Entire Audience): 10:53 AM: //Switch on LED connected on pin 10 if obstacle
is present
//A LOW from sensor on pin 2 indicates presence of obstacle

int ledpin = 10;


int sensorpin = 2;

void setup() {
pinMode(ledpin, OUTPUT);
pinMode(sensorpin, INPUT);
digitalWrite(ledpin, LOW); //Switch off LED
}

// the loop function runs over and over again forever


void loop() {

int pinstate = digitalRead(sensorpin);


if(pinstate == LOW)
digitalWrite(ledpin, HIGH);
else
digitalWrite(ledpin, LOW);
}
Shafi Patel (to All - Entire Audience): 11:12 AM: www.tinkercad.com

You might also like