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 ...

Maths Statistics for Class 10

Mean is the sum of observations divided by the total number of observations in a raw data Example:  data:  2,3,5,7                    Mean =  (2+3+5+7) / 4                    Mean = 17/4                    Mean = 4.25 Mean for Grouped data can be obtained by three methods: Direct Method Assumed Mean Method Step-deviation Method Direct Method                            Assumed Mean Method Step-deviation Method Exercise 14.1:        Click this link for Questions and Answers on Mean all 3 Models                https://drive.google.com/file/d/1DD8mvEc0boAoGwdImEJTfnWLM3Tw7p7_/view             Click this link for Questions and Answer...