Professional Documents
Culture Documents
Introduction:
PWM
IR Sensor
Connections:
Connection of atmega8 with sensor and motors
SENSORS: MOTOR:
sensor connected with PORTD Motor connected with PORTC
L = D3 IN1 = C0
C1= D2 IN2 = C1
C2= D1 IN3 = C2
R = D0 IN4 = C3
Color Detection
Sensor Arrangement On Robot
1C2 R Input Turns
Normal Programming
PWM programming
Timer1 Timer2
Here we are using timer1 and OC1A & OC1B to get PWM
utput to control the speed of motor.
Registers:
Here are some registers of AVR, which is used for
programming of PWM.
TCNT1
OCR1x + 1
Duty cycle = X 100
256
OCR1A=191
OCR1B=63
OC1A
OC1B