Skip to main content

PC BASED MOTOR CONTROL USING PIC MICROCONTROLLER

#include<htc.h>
#include "lcd.c"
#include "serial.c"


void intro()
{
 lcdclr();
 lcdstr(" PC Based Speed ");
 lcdcmd(0xc0);
 lcdstr("Ctrl of DC Motor");
 delay(65000);delay(65000);
}

void main()
        {
unsigned char ctrl;
        TRISC2=TRISB= 0 ;
TRISA  =0xff;                   // set PORTC as output
        RC2 = 1 ;                     // clear PORTC
lcdinit();delay(100);
se_init();
intro();
lcdclr();
lcdstr("Waiting For Data");
while(1)
        {
ctrl=se_rx();

switch(ctrl)
{

case '1': //90%, 250Hz
       PR2 = 0b11111001;
       T2CON = 0b00000111;
       CCPR1L = 0b11100000;
CCP1CON = 0b00111100;
lcdclr();
lcdstr("  Motor Run At  ");
lcdcmd(0xc0);
lcdstr("   Slow Speed  ");
break;

case '2': //70%, 250Hz
       PR2 =     0b11111001;
       T2CON =   0b00000111;
       CCPR1L =  0b10101110;
CCP1CON = 0b00111100;
lcdclr();
lcdstr("  Motor Run At  ");
lcdcmd(0xc0);
lcdstr("  Medium Speed  ");
break;
 
case '3': //10%, 250Hz
       PR2 = 0b11111001;
       T2CON = 0b00000111;
       CCPR1L = 0b00011000;
CCP1CON = 0b00111100 ;
lcdclr();
lcdstr("  Motor Run At  ");
lcdcmd(0xc0);
lcdstr("  Full Speed  ");
break;      

default:
lcdclr();
       lcdstr("  Wrong Data  ");
lcdcmd(0xc0);
lcdstr("   Received   ");
delay(2000);
break;            
       }
        }
}

Comments

Popular posts from this blog

Inverted Linear Quadtree: Efficient Top K Spatial Keyword Search

Inverted Linear Quadtree: Efficient Top K Spatial Keyword Search ABSTRACT: In this paper, With advances in geo-positioning technologies and geo-location services, there are a rapidly growing amount of spatiotextual objects collected in many applications such as location based services and social networks, in which an object is described by its spatial location and a set of keywords (terms). Consequently, the study of spatial keyword search which explores both location and textual description of the objects has attracted great attention from the commercial organizations and research communities. In the paper, we study two fundamental problems in the spatial keyword queries: top k spatial keyword search (TOPK-SK), and batch top k spatial keyword search (BTOPK-SK). Given a set of spatio-textual objects, a query location and a set of query keywords, the TOPK-SK retrieves the closest k objects each of which contains all keywords in the query. BTOPK-SK is the batch processing of sets...

A simple and reliable touch sensitive security system CODING

#include <REGX51.H> #include "lcd.c" #define MAX_DELAY() delay(65000) sbit Vibra_Sense=P3^1; sbit Buz=P1^0; void intro() {  lcd_init();  lcd_str("Touch Sensitive ",0x80);  lcd_str("Security System ",0xc0);  MAX_DELAY();MAX_DELAY();  lcd_clr();  }  void main()  { unsigned int i = 0, j= 0; intro();    while(1)    { lcd_str("Security Syst On",0x80); lcd_str("No Vibra Detectd",0xc0); Buz = 1; if(Vibra_Sense == 1) { while(Vibra_Sense == 1) delay(1000); } else { while(Vibra_Sense == 0) delay(1000); } Buz = 0; lcd_str("Vibraton Detectd",0xc0);delay(65000); while(1);    }  }

A Time Efficient Approach for Detecting Errors in Big Sensor Data on Cloud

A Time Efficient Approach for Detecting Errors in Big Sensor Data on Cloud Abstract                                                                                                                                                      ...