Search the Blog

Thursday, August 15, 2019

Arduino Code for ultrsonic RADAR

Micocontroller,  ROBOTICS,  Arduino Uno Board Project Example fro School and Science exibiation and College Projects.

Micocontroller,  ROBOTICS,  Arduino Uno Board Project Example fro School and Science exibiation.

#define echoPin 7
#define trigPin 8
#define LEDPin 13
int relay1=2;
int relay2=3;
int relay3=4;
int relay4=5;
int maximumRange = 200;
int minimumRange = 0;
long duration, distance;

void setup() {
 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin,  OUTPUT);
  pinMode(relay1,  OUTPUT);
   pinMode(relay2,  OUTPUT);
    pinMode(relay3,  OUTPUT);
     pinMode(relay4, OUTPUT);
}

void loop() {

 digitalWrite(trigPin, LOW);
 delayMicroseconds(2);

 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);

 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);


 distance = duration/58.2;

 if (distance >25)

 {
   digitalWrite(relay1,HIGH);
   delay(5000);
   digitalWrite(relay1,LOW);
   digitalWrite(relay2,HIGH);
   delay(5000);
 
   digitalWrite(relay2,LOW);
   digitalWrite(relay3,HIGH);
   delay(5000);
 
   digitalWrite(relay3,LOW);
   digitalWrite(relay4,HIGH);
   delay(5000);
 
   digitalWrite(relay4,LOW);

   delay(5000);
 
 }

 delay(50);
}


JAVA Sequence Pattern Program with * pattern Programming Logic and Code with Syntax

Wednesday, August 14, 2019

Arduino uno board of servo motor

Servo Motor Rotation For Perticular length

Servo Motor Rotation For Perticular length and Stop

#include <Servo.h>

Servo myservo;


int pos = 0; 

void setup()
{
  Serial.begin(9600);
  myservo.attach(9);
}

void loop()
{
  int sensorValue = analogRead(A0);

Serial.println(sensorValue);
  if(sensorValue>850)
  {
    myservo.write(0); 
      delay(5000);                               
  }
 else
 {
  myservo.write(90);
           
}
}


Arduino Code for to read three sensor reading

Arduino Code for reading the sensor data and print and test

void setup()
{
Serial.begin(9600);
}

void loop()
{
  int state = analog Read(A0) ;
  int state2 = analog Read(A1) ;
  int state3 = analog Read(A3) ;
Serial. println ( state ) ;
delay ( 1000);
Serial. println ( state2 ) ;
delay ( 1000 );
Serial. println ( state3 ) ;
delay ( 1000 )  ;
}


JavaScript Object and XML interactively methods




More popular Sites -

Translate