How do I give a radio control car autonomous control


Closed Thread
Results 1 to 40 of 191

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I got it!!

    The 44 PIN Demo board users guide clearly (in font size ~2 print on Page 35) says that the LED's are attached to PORTD.

    I changed the .BAS code per below and the LED blinks!!!

    ---------------start snip---------------
    mainloop:
    High PORTD.0 ' Turn on LED connected to PORTD.0
    Pause 500 ' Delay for .5 seconds

    Low PORTD.0 ' Turn off LED connected to PORTD.0
    Pause 500 ' Delay for .5 seconds

    Goto mainloop ' Go back to loop and blink LED forever
    End
    --------end snip----------------

    Hurray for our team!!

    Ken

  2. #2
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I just read what your last note.

    Thank you,

    I was looking for that include file, but could not find it.

    The printed documentation gave me the details about the board wiring.

    Onward and upward to bigger and better things.

    Ken

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    GREAT!!!!!!!!!!!! Glad you got it.
    Just for fun here is a "more advanced" blinky.
    You might get something out of it. You can add the comments
    Code:
    '16F887 BLINK
       @ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF & _CP_OFF
       DEFINE OSC 4
       TRISD = %00000000
       CNT  VAR BYTE
       MAINLOOP:
       FOR CNT = 0 TO 10
       HIGH PORTD.0
       LOW PORTD.1
       PAUSE 500
       LOW PORTD.0
       HIGH PORTD.1
       PAUSE 500
       NEXT CNT
       FOR CNT = 0 TO 100
       PORTD = %01
       PAUSE CNT
       PORTD = %10
       PAUSE CNT
       NEXT CNT
       GOTO MAINLOOP
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Where do I find the definitions of all those aliases?

    You used many previously defined aliases in the two INCLUDE segments as well as inside our Blink'n code;

    '16F887 BLINK
    @ __config _CONFIG1, _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _LVP_OFF

    Where are these listed? On what page of which .pdf file?

    Ken

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At or near the end of Microchips *.inc file.

    Can be found here
    C:\Program Files\Microchip\MPASM Suite

    This is the file that has pretty much everything about the chip in it.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default It worked as would be expected. However

    The compiler did not like your @ line.

    It felt that three of the aliases were unknown.

    I commented out the whole line and the program compiled, programmed and worked exactly as I imagined it would.

    I guess I have to investigate the items in the @ line.

    Meanwhile I need to pick a light sensor chip for an incandescent light bulb. Got any suggestions? I have to purchase this on line. Our local Radio Shack has no such items.

    Ken

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Did you get an "over writing previous address" error or something like that? If so then I bet the Lines in the PBP *.inc file need commented out. But setting the fuses in thae inc is good too, personal preference kind of thing.

    Light sensors. You should get a lot of feed back on that one.

    Off the top...
    I think you said that the car was going to look for a light. You may want to think about some small solar cells. Being a voltage is produced the ADC could read them directly, well it should if it is not so low a voltage as to not have a good resolution.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default Yes, it was overwriting previous address

    Yes,

    It said something like overwriting previous address. It also did not like the comma in the @ line.

    Ken

Similar Threads

  1. Car radio (Car radio and electronics support forum)
    By freewillover in forum Forum Requests
    Replies: 1
    Last Post: - 1st July 2009, 19:41
  2. Remote Car Starter Safety
    By CocaColaKid in forum General
    Replies: 8
    Last Post: - 22nd November 2005, 09:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts