Document With Collected Codes
Document With Collected Codes
Hardware Design:-
Program:-
void Rotation0() //0 Degree
{
unsigned int i;
for(i=0;i<50;i++)
{
PORTB.F0 = 1;
Delay_us(800); // pulse of 800us
PORTB.F0 = 0;
Delay_us(19200);
}
}
{
unsigned int i;
for(i=0;i<50;i++)
{
PORTB.F0 = 1;
Delay_us(2200); // pulse of 2200us
PORTB.F0 = 0;
Delay_us(17800);
}
}
void main()
{
TRISB = 0; // PORTB as Ouput Port
do
{
Rotation0(); //0 Degree
Delay_ms(1000);
Rotation90(); //90 Degree
Delay_ms(1000);
Rotation180(); //180 Degree
}
while(1);
}
int a;
void main()
{
char txt[7];
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
TRISB = 0b00010000;
INTCON.GIE = 1; //Global Interrupt Enable
INTCON.RBIF = 0; //Clear PORTB On-Change Interrupt Flag
INTCON.RBIE = 1; //Enable PORTB On-Change Interrupt
Lcd_Out(1,3,"Developed By");
Lcd_Out(2,4,"FaboTronix");
Delay_ms(3000);
Lcd_Cmd(_LCD_CLEAR);
while(1)
{
TMR1H = 0; //Setting Initial Value of Timer
TMR1L = 0; //Setting Initial Value of Timer
a = 0;
Program:
// LCD module connections
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
void main() {