Translator

Smart ToyCar


Smart ToyCar:

MikroC Code For Reciver:
//PIC16F877A
//12MHz

float reading=0 , act_reading=0, volt=0;

void Get_Volt(void)
{
                 adcon1=0b0000;
                 delay_ms(50);
                 reading=Adc_Read(0);
                 act_reading=(reading*5)/1024;
                 volt=act_reading*2.25;       //volt_in

}

void Tone() //horn
   {
      Sound_Play(500, 10);

   }
void Tone_back()
   {
      Sound_Play(2000, 300);
      delay_ms(200);
   }

void main()
{
    TRISA = 0xFF;
    porta = 0x00;
    TRISC = 0x00;        // PORT B as output port
    portc = 0x00;         // Set RB0 to high
    TRISD = 0xDF;
    portd = 0x00;
    TRISB = 0x00;
    portb = 0x00;

    Sound_Init(&PORTC, 7);  //sound Initialization

  while(1)
   {
       if(portd.f4=1)
       {
                PORTC.F0=0;
                PORTC.F1=0;
                PORTC.F2=0;
                PORTC.F3=0;
                PORTC.F5 = 0;
                PORTC.F6 = 0;
                //Charge
                Get_Volt(void);
                if(volt>9)
                {
                 portd.f5=1;
                }
                else portd.f5=0;
               
       }
      
      
      
       else
        {
                 portd.f5=0;
                  //headlight
                 if(portd.f6==1)            portc.f4 = 1;
                 else                       portc.f4 = 0;

                //forward
                if(portd.f0==1 && portd.f2==0 && portd.f3==0)
                {
                  PORTC.F0 = 1;
                  PORTC.F1 = 0;
                  PORTC.F2 = 1;
                  PORTC.F3 = 0;
                  PORTC.F5 = 0;
                  PORTC.F6 = 0;
                  portb.f0=0;
                  portb.f1=1;

                }
                //backward
                if(portd.f1==1 && portd.f2==0 && portd.f3==0)
                {
                  PORTC.F0 = 0;
                  PORTC.F1 = 1;
                  PORTC.F2 = 0;
                  PORTC.F3 = 1;
                  PORTC.F5 = 1;
                  PORTC.F6 = 1;
                  portb.f0=1;
                  portb.f1=0;
                 
                  Tone_back();
                }
                //right
                if(portd.f2==1)
                {
                  PORTC.F0 = 0;
                  PORTC.F1 = 1;
                  PORTC.F2 = 1;
                  PORTC.F3 = 0;
                  PORTC.F5 = 0;
                  PORTC.F6 = 1;
                    portb.f0=1;
                  portb.f1=0;
                  Tone_back();
                }
                //left
                if(portd.f3==1)
                {
                  PORTC.F0 = 1;
                  PORTC.F1 = 0;
                  PORTC.F2 = 0;
                  PORTC.F3 = 1;
                  PORTC.F5 = 1;
                  PORTC.F6 = 0;
                    portb.f0=1;
                  portb.f1=0;
                  Tone_back();
                }

                //To Stop motor
                 if(portd.f0==0 && portd.f1==0 && portd.f2==0 && portd.f3==0)
                {
                PORTC.F0=0;
                PORTC.F1=0;
                PORTC.F2=0;
                PORTC.F3=0;
                PORTC.F5 = 0;
                PORTC.F6 = 0;
                }

                //horn
                if(portd.f7==1)
                     Tone();
         }
        
   }

}






MikroC Code for Transmitter:

 // PIC16F73 X-TAL= 8MHz
 float reading=0 , act_reading=0;
 float volt=0;

void Get_Volt(void);

void Tone()  //volt
    {
      Sound_Play(3500, 20);
      delay_ms(100);
    }

void main()
{
  TRISA = 1;
  TRISB = 0;
  TRISC = 0x00;
  PORTB = 0;



  UART1_Init(9600); // Initialize UART module at 9600bps
  Delay_ms(100); // Wait for UART module to stabilize

  Sound_Init(&PORTC, 0);  //Sound initialization

  while (1)
  { // Endless loop

       UART1_Write(portb); //send data via UART
       Delay_ms(500);
       Get_Volt(void);
       if(volt>=4.95)
       {
       portc.f1=1;
       Tone();
       }
       else
       portc.f1=0;
  }
}

void Get_Volt(void)
        {
                 adcon1=0b000;
                 delay_ms(50);
                 reading=Adc_Read(0);
                 act_reading=(reading*20.11)/1024;
                 volt=act_reading;
        }

40 comments:

  1. Boxer briefs are King Size Male Enhancement comprehensible in aching colors and robust designs and various designs. Also manageable are boxer briefs considering fully operational flies.
    For more ==== >>>>>> http://rockhardfacts.com/king-size-male-enhancement-scam/

    ReplyDelete
  2. Water can furthermore Brain Plus IQ obsolete in the feel taking place a lot in providing the final nutrient requirements to the brain.Drinking eight to ten glasses of water keeps the brain supple and provides the required amount of oxygen.For more ==== >>>>>> http://jackedmuscleextremeadvice.com/brain-plus-iq/

    ReplyDelete
  3. However retaining your combined Crevalor body healthy makes it easier so that you can construct muscle count as competently as vitamins really are a part related following every one once reference to health. For more ==== >>>>>> http://jackedmuscleextremeadvice.com/crevalor/

    ReplyDelete
  4. There are bound to be King Size Male Enhancement customer reviews and testimonials written by professionals who have tried the products already. These product reviews are either written bearing in mind bias or have been written taking into account.For more ==== >>>>>> http://jackedmuscleextremeadvice.com/king-size-male-enhancement/

    ReplyDelete
  5. You blame your tongue Athletic Greens and your tendency to gobble tasty morsels whenever you profit the opportunity. But how come your friend who too has this thesame need manages to remain slender.And if this is not sufficient he has never visited the gym.For more ==== >>>>>> http://rockhardfacts.com/athletic-greens/

    ReplyDelete
  6. Every individual wants to Alpha Levo IQ gain a healthy cartoon and this is attainable is doable lonesome if one has the right intake of vitamins and minerals in their diet get sufficient of sleep etc.For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/alpha-levo-iq/

    ReplyDelete
  7. There are various ways by which Celleral one can lighten stretch marks. Good cosmetic cures are available nowadays which ensures invisibility of stretch marks upon the skin without any calculation harmful side effects. For more ==== >>>>>> http://www.healthsupreviews.com/celleral/

    ReplyDelete
  8. Seeing the assign help to cyber Zulander Hack threats in the world institutes are providing education in this arena. Millions of password inform document data and important files are stolen by the malicious hacker from the computer. For more ==== >>>>>> http://brainammoadvice.com/zulander-hack-scam/

    ReplyDelete
  9. That confuses a lot not knowing 1 Neuro NZT to opt for to create several added computer faster meant for pardon especially later than we are not an experienced in computers.For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/neuro-nzt/

    ReplyDelete
  10. Bending you knees humble Black Core Edge yourself until your hips are just slightly less than 90 degrees from the floor subsequently slowly reward to your starting approach. For more ==== >>>>>> http://www.healthsupreviews.com/black-core-edge/

    ReplyDelete
  11. To be in fact full of beans as Virtnext an affiliate marketer it is important to have your own website it is as well as vitriolic to connection a number of affiliate programs that are each.For more ==== >>>>>> http://brainammoadvice.com/virtnext-scam-or-fake/

    ReplyDelete
  12. The and no-one else cause why you Nitric Storm can't admit go in front is because of your belief(s) roughly why you cannot.Beliefs are meant as a spiteful scuff for the mind to make choices brusquely. For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/nitric-storm-scam/

    ReplyDelete
  13. You will discover a variety of Power Growth anabolic dietary supplements obtainable along taking into account the most widely used one is Creatine monohydrate. For more ==== >>>>> http://rockhardfacts.com/power-growth/

    ReplyDelete
  14. It is natural and herbal and Vita Luminance gone no side effects. Our skin never stops growing varying or adapting. Skin is the largest organ of our body and it needs pure avow. For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/vita-luminance-scam/

    ReplyDelete
  15. There's nothing stopping ProFactor T-2000 anyone from natural encroachment and overdo no supplements but it requires more grow old which is a consideration people think very roughly. For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/profactor-t-2000-scam/

    ReplyDelete
  16. There have been various studies Brain Plus IQ to attempt and prove that the game can press to the fore brain knack, and many have shown that those who realize court stroke live a superior level of intellect.For more ==== >>>>>> http://rockhardfacts.com/brain-plus-iq/

    ReplyDelete
  17. They contain important B Genius X vitamins and folic acid, which have a big job in taking care of the neurons in your brain. They with set aside minister to to going on sticking to oxygen flowing through your body, which is integral to healthy brain make miserable.For more ==== >>>>>> http://gmax-brasil.com/genius-x-reclame-aqui/

    ReplyDelete
  18. Undoubtedly yoga energizes Grow XL you and makes you to be well ventilated throughout the hours of day. You can slay your daily highlight once the into the future going on of regular practice of yoga. Yoga Postures can be adroit in all seasons. For more ==== >>>>>> http://rockhardfacts.com/grow-xl-scam/

    ReplyDelete
  19. The parts stuffed in Raging Raging Lion Lion are screened through vary channels to forbid the benefit of undesirable steroids or components. It was in target of fact humiliating for me to surgically remove my garments in the back my wife because of my little penis size.For more ==== >>>>>> http://ultimatemuscleblackeditionrev.com/raging-lion-scam/

    ReplyDelete
  20. And those of course function Naturaful the surgery pro because of the big payments that the women going in for breast adding make.Similarly breast prettification creams and serums are with available in the push all of which range in terms of their effectiveness.For more ==== >>>>>> http://www.healthsupreviews.com/naturaful/

    ReplyDelete
  21. If you are unconditionally Grow XL gigantic roughly getting rid of your chest fat is by signing occurring to a local gym and starting to exercise more often if you dont already reach it. For more ==== >>>>>> http://jackedmuscleextremeadvice.com/grow-xl-male-enhancement/

    ReplyDelete
  22. For outdoor application you can XtraSize go for Overnight oil which will put in the blood flow into your sex organ by relaxing the muscles of the genital. These are two of the best products that you can rely a propos in this regard. For more ==== >>>>>> http://superpowervxfunciona.com/xtrasize-efeitos-colaterais/

    ReplyDelete
  23. The employer seeks an employee Midas Touch that can transform his company from the doldrums to the pinnacle of glory. The destitute set sights on for a reversal of their fortunes from poverty and scarcity to prosperity excess and abundance. For more ==== >>>>>> http://brainammoadvice.com/midas-touch-scam-or-not/

    ReplyDelete
  24. Each one may compulsion choice Alpha XTRM amount of land so it proves satisfying to locate out what works best for you.Keep a journal of your workouts to book your rearrange helps to insist the finishing of your fastest mannerism to produce muscle program. For more ==== >>>>>> http://jackedmuscleextremeadvice.com/alpha-xtrm-scam/

    ReplyDelete
  25. The downsides to this food plan Fit Burn are that the primary weeks require plenty of strength of will due to the fact your body has been used to having those extra carbohydrates and now it has none. human beings in this weight-reduction plan can every so often revel in weak spot and shakiness due to the shortage of carbs.For more ==== >>>>>> http://superpowervxfunciona.com/fit-burn-funciona/

    ReplyDelete
  26. As soon as a nurse finds out that Lift X they can preserve there day job (or night time shift) and start a nursing staffing employer on the side and make over $100,000 a 12 months in greater profits they quickly start and try and discover the way to get commenced.For more ==== >>>>>> http://realcemasculinobr.com/lift-x-farsa-ou-falso/

    ReplyDelete
  27. In keeping with the centers for Intelimax IQ disease control CDC, a disturbing mind damage is an damage this is as a result of a blow or jolt to the head or a penetrating injury that disrupts the normal function of the mind.For more ==== >>>>>> http://realcemasculinobr.com/e-intelimax-iq-embuste/

    ReplyDelete
  28. Every other type of collar that Oxinova can be used for education is the surprise collar. This collar offers a managed electric shock to the animal; the level of the surprise and when to manage it's far decided by means of the instructor.For more ==== >>>>>> http://realcemasculinobr.com/oxinova-funciona-mesmo/

    ReplyDelete
  29. Some other element which you MegaDrox need to do is to run a disk errors take a look at. it's miles really one of the satisfactory slow pc fix due to the fact it can locate errors and terrible sectors on your tough disk that might be the reason of your laptop s slowing down.For more ==== >>>>>> http://www.healthsupreviews.com/megadrox-scam/

    ReplyDelete
  30. A phrase of warning for the ones Apexatropin wishing to begin a modeling career in one of the worlds most affluent emirates dubai is clearly vital. there are many reliable businesses and lots of amazing careers looking ahead to spokesperson catwalk health and vehicle fashions.For more ==== >>>>>> http://guidemesupplements.com/apexatropin-scam-or-fake/

    ReplyDelete
  31. The appearance at the lodge in hamburg Testadrox from all instructions are very secure and clean for the visitors. essentially, outdoor the lodges hamburg, there are big automobile parking so that none of the visitor may have any problem regarding this.For more ==== >>>>>> http://guidemesupplements.com/testadrox-scam/

    ReplyDelete
  32. If manipulation is important Megadrox consults the patient before treatment in order that there are never any surprises. further, dr. ozar believes in manipulating the backbone most effective when the muscle tissue and joints are limber, so all chiropractic treatments are preceded via at least forty five mins of massage remedy and/or acupuncture to loosen the muscle mass.For more ==== >>>>>> http://jackedmuscleextremeadvice.com/megadrox-side-effects/

    ReplyDelete
  33. It s now not genuinely a exquisite Megadrox concept to strive negotiating your self. it s higher to go along with a real estate agent to give the provide which you want to make. you could hesitate if you make the offer your self, however a actual property agent will do the task higher for you with out emotions and feelings getting within the manner.For more ==== >>>>>> http://guidemesupplements.com/is-megadrox-safe-for-men/

    ReplyDelete
  34. premium cleanse numbers in the two thirties that let me know that going back to the 246 just not an option I love treating myself my next goal by myself I pair of super expensive glasses really excited to wear them and go after ..

    http://optimalstackfacts.us/premium-cleanse-effective-waste-removal

    ReplyDelete
  35. premium cleanse I just isolate myself from everything and I was like okay I can go there I can do this like any this because that's a trigger not going to different events and functions what we gonna fix my problem you know staying away from a triggers was not going fast the main issue which was just the fact that it was just a habit it was an estate and I just needed simply break the habit you're constantly thinking about you know okay where my sugars and while I have to stay.

    http://optimalstackfacts.us/premium-cleanse-effective-waste-removal

    ReplyDelete
  36. I've made $64,000 so far this year w0rking 0nline and I'm a full time student. I'm using an 0nline business opportunity I heard about and I've made such great m0ney. It's really user friendly and I'm just so happy that I found out aboutit. Here’s what I've beendoing…
    O════► =============== >> http://www.pocket-cents50.com

    ReplyDelete
  37. I've made $64,000 so far this year w0rking 0nline and I'm a full time student. I'm using an 0nline business opportunity I heard about and I've made such great m0ney. It's really user friendly and I'm just so happy that I found out aboutit. Here’s what I've beendoing…
    O════► =============== >> http://www.pocket-cents50.com

    ReplyDelete