Help with a draft of a robóvia rf


Closed Thread
Results 1 to 40 of 40

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cesar35 View Post
    I did several projects in asm. I do not have much practice in picbasic. More
    do a very light flashes on facil.em asm.
    And my first project in picbasic.que I try fazer.mais not had much success.
    You could ajuda.impretada.ficarei me very grateful.
    Thank you
    OK, Lets get familiar with PBP.
    First read this thread
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    It talks about setting the config bits in your code.
    Then read this
    http://www.picbasic.co.uk/forum/showthread.php?t=561

    Being that you have written in ASM I will assume you have MPASM installed.
    And I will also assume you are also using Micro Code Studio to write your PBP code in.
    In MCS go to view-Compiler Options and make sure the bos "use MPASM" is checked.

    Now the beginning of your code will look something this
    Code:
    DEFINE OSC 4
    @__config _XT_OSC & _WDT_ON & _CP_OFF
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default ruf-bot

    Dear mackrackit is the correct code to do
    Thank you

    'DEFINE OSC 4
    '@__config _XT_OSC & _WDT_ON & _CP_OFF
    'symbol trisb = 134
    'symbol trisa = 133
    'symbol portb = 6
    'symbol porta = 5
    'low 1
    'input 0
    'input 2

    'start:
    'pot 0,50,B0

    'pot 2,50,B1
    'B0 = B0 * 5
    'B1 = B1 * 5
    'y:
    'if B0 < 100 then yf
    'if B0 > 150 then yb

    'x:
    'if B1 < 100 then xr
    'if B1 > 150 then xl
    'serout 1,n9600,(5)
    'goto start

    'yf:
    'serout 1,n9600,(2)
    'goto start

    'yb:
    'serout 1,n9600,(1)
    'goto start

    'xl:
    'serout 1,n9600,(3)
    'goto start

    'xr:
    'serout 1,n9600,(4)
    'goto start

    'end

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


    Did you find this post helpful? Yes | No

    Default

    No, you still have not dealt with the variables.

    Take a look in the PBP manual about variables and symbols.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    No, you still have not dealt with the variables.

    Take a look in the PBP manual about variables and symbols.
    Which is to say, you cannot store information in a variable which does not exist. In C you would declare the variable. In PBP you still must set it up first . . . Myvar var byte or MyVar var WORD in other words You Forgot to do this.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default ruf-bot

    foto picbasic
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Everything is commented out " ' "

    At least it will compile nothing
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Red face ruf-bot

    Dear mackrackit I'm taking stick.
    At picbasic I'm very difficult to understand I'm using the English translator. Could make new code. For me.
    I will be grateful.

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


    Did you find this post helpful? Yes | No

    Default

    I do not have time to write your code.
    But here is some old code you can look at to see how Pic Basic code is written.
    It basically is a test code for a POT.
    And read the threads I linked you to earlier.
    Code:
    '#####################
    '16F877A
    
    DEFINE OSC 20
    
    '####################
    'LCD SET UP
    DEFINE LCD_DREG     PORTB
    define LCD_DBIT     4
    DEFINE LCD_RSREG    PORTB
    DEFINE LCD_RSBIT    1
    DEFINE LCD_EREG     PORTB
    DEFINE LCD_EBIT     0
    DEFINE LCD_BITS     4
    DEFINE LCD_LINES    2
    DEFINE LCD_COMMANDUS    2000
    DEFINE LCD_DATAUS   50
    
    '#####################
    V1		VAR	BYTE
    LED	VAR	PORTD.2
    
    PAUSE 1000
    
    RUN:
    LCDOUT $FE,1,"POT"
    LCDOUT $FE,$C0,DEC V1
    PAUSE 100
    POT PORTC.7,127,V1
    IF V1 < 100 THEN
    GOTO LMP1
    ELSE 
    GOTO LMP2
    ENDIF
    GOTO RUN
    
    LMP1:
    HIGH LED
    GOTO RUN
    
    LMP2:
    LOW LED
    GOTO RUN
    
    END
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Unhappy ruf-bot

    Dear mackrackit I am very grateful for pacincia.
    more just one more dica.Porque that picbasic Compiler without error. generates the hex normal. more pic does not send the data for the receiver. thank you again ..

Similar Threads

  1. Control NEXA 230V RF Switch
    By Fredrick in forum Code Examples
    Replies: 3
    Last Post: - 6th December 2009, 23:19
  2. Generic RF Receiver
    By dhouston in forum Code Examples
    Replies: 0
    Last Post: - 8th September 2009, 14:35
  3. Interfacing 16F88 to RF module
    By scomi85 in forum General
    Replies: 2
    Last Post: - 19th February 2009, 12:52
  4. RF Module
    By shahidali55 in forum General
    Replies: 22
    Last Post: - 9th March 2007, 09:00
  5. Interfacting RF Module
    By rastan in forum General
    Replies: 8
    Last Post: - 10th November 2004, 22:27

Members who have read this thread : 1

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

Posting Permissions

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