LINE FOLLOWER ROBOT PROGRAMMING

pic programming

  • Programming  is the next step that you should do after building your line follower. This is a sample of the programming for line follower robot that are using PIC16877A microcontroller. This program can be use for the circuit on my previous post Line Follower Robot. If you haven’t already read it, I suggest you read it before going any further in this post.



#include <pic.h>
__CONFIG(0x3732);

void main ()

{          int x;                                                    //declare variable x as integer type
            TRISD = 0b00000000;                       //select port D as output for motor direction and LED
            TRISC = 0b00000000;                       //select port C as output for motor enable
            PORTC = 0b00000000;                     

            PR2 = 249;                                          //set period = 200µs @ frequency = 5 kHz    
            T2CON = 0b00000111;                      //timer 2 ON, prescaler is 16
            CCP1CON = 0b00001100;                //set CCP1 as PWM mode
            CCP2CON = 0b00001100;                //set CCP2 as PWM mode
            CCPR1L = 249;                                 //set duty cycle = 100%
            CCPR2L = 249;                                 // set duty cycle = 100%
           
            CMCON = 0b00000110;                    //set for internal voltage reference
            CVRCON = 0b11101001;                  //set Vref = 3.125 volts

            while(1)
                        {          if(C1OUT==1 && C2OUT==1){                  //if both sensor detect white area
                                                CCPR1L = 113;                                  //set duty cycle = 45%
                                                CCPR2L = 118;                                  //set duty cycle = 47%
                                                PORTD = 0b00000110;}                   //robot is straight on the line, robot
            move straight forward

else if(C1OUT==1 && C2OUT==0){           //sensor 1 detect white area while 
            sensor 2 detect black area
                                                CCPR1L = 165;                                  //set duty cycle = 66%
                                                CCPR2L = 165;                                  //set duty cycle = 66%
                                                PORTD=0b10001010;}                      //robot steers to the left

                                    else if(C1OUT==0 && C2OUT==1){           //sensor 1 detect black area while
            sensor 2 detect white area
                                                CCPR2L = 165;                                  //set duty cycle = 66%
                                                CCPR1L = 165;                                  //set duty cycle = 66%
                                                PORTD=0b10000101;}                      //robot steers to the right

                                    else if(C1OUT==0 && C2OUT==0){           //both sensor detect black area
                                                PORTD=0b00000000;}                      //robot will stop moving
                       
                   }

}

EPL Results

Uma Thurman's Face


Uma Thurman face

.

Uma Thurman face


Uma Thurman face


Uma Thurman face




10 Best Ping Page 2015

10 Best Ping Page 2015
Top ping sites

1. Google Ping - One of the sites that have high rankings and easy to use.

2. Pingler popular among Malaysian bloggers.

3. Ping-O-Matic - Serve several search engines that your blog has been updated

4. IM.org Backlink Supercharger -  The indices that provide information of your         domain to the site like Alexa, analitic Woorank, Quarkbase and various other search     engines.

5. Bulk Ping A unique Mass Auto Ping to promote your blog.

6. Ping Farm - Serve search engines that your blog has been updated.

7. Feed Shark Free service online your blog to friends yard.

8. Ping My Blog -Tell all major blog directory that your blog has been updated.

9. Pingates - ' Ping ' your blog more than 40 search engines.

10. Ping That Blog - This page provides qualitative services to ping your blog.

Use this page to ping your blog don't ping too much cause you could potentially get a penalty from Google. happy ' pingging '