Skip to main content

Robotics using Arduino

Robotics using Arduino 
onchipLEDonprogram:

void setup() 
{
  // put your setup code here, to run once:
  pinMode(13, OUTPUT);
}

void loop() 
{
  // put your main code here, to run repeatedly:
  digitalWrite(13,HIGH);
}

onchipLEDoffprogram

void setup() {
  // put your setup code here, to run once:
pinMode(13, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(13,LOW);
}

onboardLEDblink1secdelay

void setup() {
  // put your setup code here, to run once:
pinMode(13, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(13,LOW);
delay(1000);
digitalWrite(13,HIGH);
delay(1000);
}


externalLEDON1secOFF2secdelay

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(2,LOW);
delay(2000);
digitalWrite(2,HIGH);
delay(1000);
}

external4LEDspattern

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
delay(500);

digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
delay(500);

digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
delay(500);

digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
delay(500);

digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
delay(500);

}




LED s Pattern Using For loop:
int i,j;
void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
for(i=1; i++ ; i<=5)
{
digitalWrite(i,HIGH);
j = i*500;
delay(j);
}}

IRSensorandonchipled

void setup() {
  // put your setup code here, to run once:
pinMode(6, INPUT);
pinMode(13, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
int x = digitalRead(6);
if(x==1)
{
  digitalWrite(13,HIGH);

}
else
{
digitalWrite(13,LOW);
}

}


Automatic Hand Sanitizer 

int y;
void setup() {
  // put your setup code here, to run once:
pinMode(6,OUTPUT);
pinMode(8,INPUT);
y=0;

}

void loop() {
  // put your main code here, to run repeatedly:
  
int x = digitalRead(8);
digitalWrite(6,HIGH);
if (x==0 && y==0)
{
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(6,HIGH);
  y=1;
  
}
else if(x==1)
{
  y=0;
   digitalWrite(6,HIGH);
}

}


onedcmotorprogram(Clockwise Rotation)

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
}


onedcmotorprogram(Anticlockwise direction)

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(3,HIGH);
digitalWrite(2,LOW);
}
robotmovingfront

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
}

robotmovingback

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
}

oneirandrobot

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

pinMode(6,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
int x = digitalRead(6);
if(x==1)
{
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
}
else
{
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
}
}

twoirandrobot

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

pinMode(6,INPUT);
pinMode(7,INPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
int x = digitalRead(6);
int y = digitalRead(7);

if(x==1 & y==1)
{
digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
}
else if(x==0 & y==1)
{
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
}
else if(x==1 & y==0)
{
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
}
else
{
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
}
}

To generate .hex file in Arduino IDE:
Step1: Click on File
Step2: Click on Preferences
Step3: Check the box compilation at show verbose output during.


Where .hex file get generated:
Step1: Compile the program in Arduino IDE.
Step2: In the Console Window you will get Location of .hex file generated.

Arduino IDE


How to add any Proteus Library to Proteus Software:
Step1: Download the Required Proteus Library 
Step2: Extract the zip folder.
Step3: Copy .IDX and .LIB files.
Step4: Paste the two files at C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY

Arduino IDE:

Proteus Arduino Library:

Proteus Infrared Sensor Library:
https://www.theengineeringprojects.com/2018/07/infrared-sensor-library-for-proteus.html

Proteus Motor Driver Library:

Popular posts from this blog

Sensors and Transducers for JNTUH Final Year Complete Notes.

The Sensors and Transducers Course divided into 5 units: In Unit I we will discuss about  Measurements,   Errors,  Sensor,  Transducer and its Classification. In Unit II we will discuss about  Characteristics of Transducers ,  Static  &  Dynamic  In Unit III, IV, V we will discuss about   Resistive Transducers,  Inductive and Capacitive Transducer,  Miscellaneous Transducers Course Objectives: To enable the students to select and design suitable instruments to meet the requirements of industrial applications and various transducers used for the measurement of various physical quantities and the following: Various types of Sensors & Transducers and their working principle Resistive, Capacitive and Inductive transducers Some of the miscellaneous transducers Characteristics of transducers Course Outcomes: Student will be able to Distinguish, analyse different types of errors. Students will be able to apply transforms ...

EDC

Unit 1 Part 1: PN Junction Diode Click the below link the lecture notes https://drive.google.com/file/d/1AcoRvK6wKmObQW8XEKx0n0I77VFqDHzA/view?usp=sharing e-text books for EDC  Click the below link:

Active and Passive Voice

ACTIVE & PASSIVE VOICE ACTIVE VOICE STRUCTURE: SUB + VERB + OBJ u The active voice is when the person or thing performing the verb is also the subject of the sentence. u The subject always comes before the verb . u The active voice makes the subject the focus of the sentence . EXAMPLE: ➢His parents are always praising him. ➢Lee Harvey Oswald assassinated John F. Kennedy . u I love my students Passive Voice STRUCTURE: OBJ + HV + VERB(V3) + BY + SUB u By using the passive voice, we make the object the focus of the sentence . u When we not aware of subject. u When subject is not important. EXAMPLE: u He is always being praised by his parents . u John F. Kennedy was assassinated by Lee Harvey Oswald . u My students are loved by me. STEPS TO CONVERT u IDENTIFY SUB, OBJ, VERB. u SWAP  SUB & OBJ u CONVERT VERB TO V3 FORM u ADD HELPING VERB BEFORE MAIN VERB u ADD BY BEFORE SUB. WHILE CHANGING SUBJECT TO OBJ u I      CHANGE ...