SlideShare a Scribd company logo
Moving the bot…..
MOTOR 1 MOTOR 2 MOVEMENT
10 01 FORWARD
10 00 SLIGHT RIGHT
10 10 SHARP RIGHT
00 01 SLIGHT LEFT
01 01 SHARP LEFT
01 10 BACKWARD
BOT
Wheels
Lets Program the Motors…
#include<avr/io.h>
#include<compat/deprecated.h>
#include<util/delay.h>
int main(void)
{
DDRD=0b11111111; //PORT D pins are output//
sbi(PORTD,4); //Set bit 4 of port D//
sbi(PORTD,5); //Set bit 5 of port D//
DDRC=0b11110000;
while(1)
{
PORTC=0b10010000; //Move Forward
}
}
#include<avr/io.h>
#include<compat/deprecated.h>
#include<util/delay.h>
int main(void)
{
DDRD=0b11111111; //PORT D pins are output//
sbi(PORTD,4); //Set bit 4 of port D//
sbi(PORTD,5); //Set bit 5 of port D//
DDRC=0b11110000;
while(1)
{
PORTC=0b10010000; //Move Forward
_delay_ms(1000);
PORTC=0b01100000; //Move Backward
_delay_ms(1000);
}
Lets turn the bot…..#include<avr/io.h>
#include<compat/deprecated.h>
#include<util/delay.h>
int main(void)
{
DDRD=0b11111111; //PORT D pins are
output//
sbi(PORTD,4); //Set bit 4 of port D//
sbi(PORTD,5); //Set bit 5 of port D//
DDRC=0b11110000;
while(1)
{
PORTC=0b10000000; //Slight right turn
_delay_ms(1000);
PORTC=0b10100000; //Sharp right turn
_delay_ms(1000);
}}
Now take a left turn….
#include<avr/io.h>
#include<util/delay.h>
int main(void)
{
DDRD=0b11111111; //PORT D pins are output//
sbi(PORTD,4); //Set bit 4 of port D//
sbi(PORTD,5); //Set bit 5 of port D//
DDRC=0b00001111;
while(1)
{
PORTC=0b00010000; //Slight left turn
_delay_ms(1000);
PORTC=0b01010000//Sharp left turn
_delay_ms(1000);
}

More Related Content

What's hot

Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
Kaku Tomohiro
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
Soumya Behera
 
Micro
MicroMicro
Micro
Moaz Zahid
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1
babak danyal
 
VOCODER LST 72 pin signal data
VOCODER LST  72 pin signal dataVOCODER LST  72 pin signal data
VOCODER LST 36 pin signal data
VOCODER LST 36 pin signal dataVOCODER LST 36 pin signal data
Advanced motion controls mc1xdz01
Advanced motion controls mc1xdz01Advanced motion controls mc1xdz01
Advanced motion controls mc1xdz01
Electromate
 
Interrupts
InterruptsInterrupts
Interrupts
PRADEEP
 
Gd35 manual v1.5
Gd35 manual v1.5Gd35 manual v1.5
Gd35 manual v1.5
Toàn Huỳnh
 
Two digit-countdown-timer
Two digit-countdown-timerTwo digit-countdown-timer
Two digit-countdown-timer
HEATLBJ
 
Sample slide Allen-Bradley
Sample slide Allen-BradleySample slide Allen-Bradley
Sample slide Allen-BradleyChris Hart
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
Jeni Shah
 
Advanced motion controls mc1xdz
Advanced motion controls mc1xdzAdvanced motion controls mc1xdz
Advanced motion controls mc1xdz
Electromate
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
Omkar Rane
 
CODING IN ARDUINO
CODING IN ARDUINOCODING IN ARDUINO
CODING IN ARDUINOS Ayub
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiMuhammad Abdullah
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
babak danyal
 
Advanced motion controls mc1xzdcr
Advanced motion controls mc1xzdcrAdvanced motion controls mc1xzdcr
Advanced motion controls mc1xzdcr
Electromate
 

What's hot (19)

Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
Nefrock勉強会 in大岡山「FPGAでゲーム機を作ろう!の会」Day4
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
Micro
MicroMicro
Micro
 
Micro Assignment 1
Micro Assignment 1Micro Assignment 1
Micro Assignment 1
 
Robotic control
Robotic controlRobotic control
Robotic control
 
VOCODER LST 72 pin signal data
VOCODER LST  72 pin signal dataVOCODER LST  72 pin signal data
VOCODER LST 72 pin signal data
 
VOCODER LST 36 pin signal data
VOCODER LST 36 pin signal dataVOCODER LST 36 pin signal data
VOCODER LST 36 pin signal data
 
Advanced motion controls mc1xdz01
Advanced motion controls mc1xdz01Advanced motion controls mc1xdz01
Advanced motion controls mc1xdz01
 
Interrupts
InterruptsInterrupts
Interrupts
 
Gd35 manual v1.5
Gd35 manual v1.5Gd35 manual v1.5
Gd35 manual v1.5
 
Two digit-countdown-timer
Two digit-countdown-timerTwo digit-countdown-timer
Two digit-countdown-timer
 
Sample slide Allen-Bradley
Sample slide Allen-BradleySample slide Allen-Bradley
Sample slide Allen-Bradley
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
Advanced motion controls mc1xdz
Advanced motion controls mc1xdzAdvanced motion controls mc1xdz
Advanced motion controls mc1xdz
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
CODING IN ARDUINO
CODING IN ARDUINOCODING IN ARDUINO
CODING IN ARDUINO
 
Solution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidiSolution manual 8051 microcontroller by mazidi
Solution manual 8051 microcontroller by mazidi
 
22 microcontroller programs
22 microcontroller programs22 microcontroller programs
22 microcontroller programs
 
Advanced motion controls mc1xzdcr
Advanced motion controls mc1xzdcrAdvanced motion controls mc1xzdcr
Advanced motion controls mc1xzdcr
 

Similar to Controlling Motors for Robot

PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
hairilfaiz86
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
SANTIAGO PABLO ALBERTO
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
Syed Ghufran Hassan
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
forwardcom41
 
Flicking LED C code
Flicking LED C codeFlicking LED C code
Flicking LED C code
Akash Patel
 
báo cáo thực hành kỹ thuật vi xử lý PTIT
báo cáo thực hành kỹ thuật vi xử lý PTITbáo cáo thực hành kỹ thuật vi xử lý PTIT
báo cáo thực hành kỹ thuật vi xử lý PTIT
nataliej4
 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
Varun A M
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
SIGMATAX1
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuenteBlackD10
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprograms
Vedavyas PBurli
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller Swapnil2515
 
Mini Project- Stepper Motor Control
Mini Project- Stepper Motor ControlMini Project- Stepper Motor Control
mod-4.pptx
mod-4.pptxmod-4.pptx
mod-4.pptx
MaheshRgk
 
What's wrong with my code- I am coding a battleship game that uses a d (1).pdf
What's wrong with my code- I am coding a battleship game that uses a d (1).pdfWhat's wrong with my code- I am coding a battleship game that uses a d (1).pdf
What's wrong with my code- I am coding a battleship game that uses a d (1).pdf
atexgarments
 
LED
LEDLED
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
ABHISHEK MAURYA
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
julioalexanderaguila
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
alltiusind
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
Neil Mendoza
 

Similar to Controlling Motors for Robot (20)

PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
Microcontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docxMicrocontroladores: programas de CCS Compiler.docx
Microcontroladores: programas de CCS Compiler.docx
 
codings related to avr micro controller
codings related to avr micro controllercodings related to avr micro controller
codings related to avr micro controller
 
Combine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdfCombine the keypad and LCD codes in compliance to the following requ.pdf
Combine the keypad and LCD codes in compliance to the following requ.pdf
 
Flicking LED C code
Flicking LED C codeFlicking LED C code
Flicking LED C code
 
báo cáo thực hành kỹ thuật vi xử lý PTIT
báo cáo thực hành kỹ thuật vi xử lý PTITbáo cáo thực hành kỹ thuật vi xử lý PTIT
báo cáo thực hành kỹ thuật vi xử lý PTIT
 
Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
 
Codigo fuente
Codigo fuenteCodigo fuente
Codigo fuente
 
Microcontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprogramsMicrocontroller (8051) general and simple alp n cprograms
Microcontroller (8051) general and simple alp n cprograms
 
Pwm wave
Pwm wave Pwm wave
Pwm wave
 
PWM wave generator using microcontroller
 PWM wave generator using microcontroller  PWM wave generator using microcontroller
PWM wave generator using microcontroller
 
Mini Project- Stepper Motor Control
Mini Project- Stepper Motor ControlMini Project- Stepper Motor Control
Mini Project- Stepper Motor Control
 
mod-4.pptx
mod-4.pptxmod-4.pptx
mod-4.pptx
 
What's wrong with my code- I am coding a battleship game that uses a d (1).pdf
What's wrong with my code- I am coding a battleship game that uses a d (1).pdfWhat's wrong with my code- I am coding a battleship game that uses a d (1).pdf
What's wrong with my code- I am coding a battleship game that uses a d (1).pdf
 
LED
LEDLED
LED
 
Atmega lcd programing_with_header_file
Atmega lcd programing_with_header_fileAtmega lcd programing_with_header_file
Atmega lcd programing_with_header_file
 
LCD_Example.pptx
LCD_Example.pptxLCD_Example.pptx
LCD_Example.pptx
 
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
GENESIS BOARD MINI SUMO ROBOT PROGRAMFOR 3 OPPONENT SENSOR, .pdf
 
Musical Machines and Flapping Phones
Musical Machines and Flapping PhonesMusical Machines and Flapping Phones
Musical Machines and Flapping Phones
 

More from Varad Manglekar

Cross Helmet
Cross HelmetCross Helmet
Cross Helmet
Varad Manglekar
 
Basic concepts of practical electronics
Basic concepts of practical electronicsBasic concepts of practical electronics
Basic concepts of practical electronics
Varad Manglekar
 
Sensors and Switches
Sensors and SwitchesSensors and Switches
Sensors and Switches
Varad Manglekar
 
Motors
MotorsMotors
Line follower robot
Line follower robotLine follower robot
Line follower robot
Varad Manglekar
 
Introduction to Embedded System
Introduction to Embedded System Introduction to Embedded System
Introduction to Embedded System
Varad Manglekar
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Varad Manglekar
 
Basic components in Embedded System
Basic components in Embedded SystemBasic components in Embedded System
Basic components in Embedded System
Varad Manglekar
 
simple ADC Interfacing
simple ADC Interfacingsimple ADC Interfacing
simple ADC Interfacing
Varad Manglekar
 
Basic interfacing of LEDs
Basic interfacing of LEDsBasic interfacing of LEDs
Basic interfacing of LEDs
Varad Manglekar
 

More from Varad Manglekar (10)

Cross Helmet
Cross HelmetCross Helmet
Cross Helmet
 
Basic concepts of practical electronics
Basic concepts of practical electronicsBasic concepts of practical electronics
Basic concepts of practical electronics
 
Sensors and Switches
Sensors and SwitchesSensors and Switches
Sensors and Switches
 
Motors
MotorsMotors
Motors
 
Line follower robot
Line follower robotLine follower robot
Line follower robot
 
Introduction to Embedded System
Introduction to Embedded System Introduction to Embedded System
Introduction to Embedded System
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Basic components in Embedded System
Basic components in Embedded SystemBasic components in Embedded System
Basic components in Embedded System
 
simple ADC Interfacing
simple ADC Interfacingsimple ADC Interfacing
simple ADC Interfacing
 
Basic interfacing of LEDs
Basic interfacing of LEDsBasic interfacing of LEDs
Basic interfacing of LEDs
 

Recently uploaded

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
Kerry Sado
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 

Recently uploaded (20)

DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Hierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power SystemHierarchical Digital Twin of a Naval Power System
Hierarchical Digital Twin of a Naval Power System
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 

Controlling Motors for Robot

  • 1.
  • 2. Moving the bot….. MOTOR 1 MOTOR 2 MOVEMENT 10 01 FORWARD 10 00 SLIGHT RIGHT 10 10 SHARP RIGHT 00 01 SLIGHT LEFT 01 01 SHARP LEFT 01 10 BACKWARD
  • 4. Lets Program the Motors… #include<avr/io.h> #include<compat/deprecated.h> #include<util/delay.h> int main(void) { DDRD=0b11111111; //PORT D pins are output// sbi(PORTD,4); //Set bit 4 of port D// sbi(PORTD,5); //Set bit 5 of port D// DDRC=0b11110000; while(1) { PORTC=0b10010000; //Move Forward } }
  • 5. #include<avr/io.h> #include<compat/deprecated.h> #include<util/delay.h> int main(void) { DDRD=0b11111111; //PORT D pins are output// sbi(PORTD,4); //Set bit 4 of port D// sbi(PORTD,5); //Set bit 5 of port D// DDRC=0b11110000; while(1) { PORTC=0b10010000; //Move Forward _delay_ms(1000); PORTC=0b01100000; //Move Backward _delay_ms(1000); }
  • 6. Lets turn the bot…..#include<avr/io.h> #include<compat/deprecated.h> #include<util/delay.h> int main(void) { DDRD=0b11111111; //PORT D pins are output// sbi(PORTD,4); //Set bit 4 of port D// sbi(PORTD,5); //Set bit 5 of port D// DDRC=0b11110000; while(1) { PORTC=0b10000000; //Slight right turn _delay_ms(1000); PORTC=0b10100000; //Sharp right turn _delay_ms(1000); }}
  • 7. Now take a left turn…. #include<avr/io.h> #include<util/delay.h> int main(void) { DDRD=0b11111111; //PORT D pins are output// sbi(PORTD,4); //Set bit 4 of port D// sbi(PORTD,5); //Set bit 5 of port D// DDRC=0b00001111; while(1) { PORTC=0b00010000; //Slight left turn _delay_ms(1000); PORTC=0b01010000//Sharp left turn _delay_ms(1000); }