0% found this document useful (0 votes)
22 views

Iot

Iot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Iot

Iot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Robot hand cut off while entering nearby

int echoPin=12;
int trigPin=10;
int led=6;
long duration;
int distance;
#include<Servo.h>
Servo servo_9;

void setup()
{
Serial.begin(9600);
pinMode(trigPin,OUTPUT);
pinMode(echoPin,INPUT);
servo_9.attach(9,500,2500);
pinMode(led,OUTPUT);
}
void loop()
{
digitalWrite(trigPin,LOW);
delay (2000);
digitalWrite(trigPin,HIGH);
delay(2000);
digitalWrite(trigPin,LOW);
duration = pulseIn(echoPin,HIGH);
distance=((duration*0.034)/2);
Serial.print("Distance");
Serial.print(distance);
Serial.print("cm");
if (distance>15)
{
digitalWrite(led,HIGH);
servo_9.write(90);
}

else
{
servo_9.write(10);
digitalWrite(led,LOW);
}
}

PIR SENSOR USED IN HOME AREA


void setup()
{
pinMode(7,INPUT);
pinMode(8,OUTPUT);
}

void loop()
{

if(digitalRead(7)==HIGH)
{
digitalWrite(8,HIGH);
}

{
digitalWrite(8,LOW);
}
}
ARDUINO IDE INSTALLING METHOD :-

CHROME

ARDUINO IDE

1ST LINK CLICK OPEN

CHOOSE THE SOFTWARE WITH OUR LAPTOP SPECIFICATION

CLICK THE DOWNLOAD (right side version details)

JUST DOWNLOAD

JUST DOWNLOAD

INSTALL

SUPPOSE PORT IS UNAVAILABLE JUST INSTALL THIS DRIVE

CHROME

CH340 DRIVE

OEM DRIVER

SCROLL DOWN DOWNLOAD LINK

DOWNLOAD AND INSTALL

You might also like