Demo version...


Closed Thread
Results 1 to 5 of 5

Thread: Demo version...

Hybrid View

  1. #1
    damu's Avatar
    damu Guest


    Did you find this post helpful? Yes | No

    Default new to pic basic please

    i am new to picbasic i have a code that was for picbasic but it is not running on picbasicpro demo versio please guide me for the same

    ------code---
    symbol porta = 5
    symbol trisa = 133
    symbol portb = 6
    symbol trisb =134
    poke trisa, 255
    poke trisb, 240
    b0 var byte
    start:

    peek portb, b0
    if bit4 = 0 then trigger
    endif
    goto start
    trigger:
    pause 500
    peek portb, b0
    if bit5 = 1 then send
    endif
    goto start
    send:
    peek porta, b0
    if bit4 = 1 then eleven
    poke portb,b0
    endif
    goto start
    eleven:
    if bit0 = 0 then ten
    poke portb,11
    endif
    goto start
    ten:
    poke portb,10
    goto start
    end
    -----------

    please help

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by damu View Post
    i am new to picbasic i have a code that was for picbasic but it is not running on<font color=red> picbasicpro demo versio </font color>please guide me for the same

    ------code---
    symbol porta = 5
    symbol trisa = 133
    symbol portb = 6
    symbol trisb =134
    poke trisa, 255
    poke trisb, 240
    b0 var byte
    start:

    peek portb, b0
    if bit4 = 0 then trigger
    endif
    goto start
    trigger:
    pause 500
    peek portb, b0
    if bit5 = 1 then send
    endif
    goto start
    send:
    peek porta, b0
    if bit4 = 1 then eleven
    poke portb,b0
    endif
    goto start
    eleven:
    if bit0 = 0 then ten
    poke portb,11
    endif
    goto start
    ten:
    poke portb,10
    goto start
    end
    -----------

    please help
    It looks like PBasic not pro, peek and poke are a not recomenended, but still supported method. In the pro version you can control ports directly using the Port and TRIS commands.
    I. E. instead of symbol porta = 5 and symbol trisa = 133 you would write TRISA = 133 or TRISA = %10000101 or TRISA = $85 and PortA = 5 or PortA=$5 or PortA=%00000101, symbol is used to alias a variable but not to create it. This is however the correct thread for PIC basic, but you need to know the pro version is different.
    Last edited by Archangel; - 21st November 2007 at 10:08.
    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.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Almost it, i think it's also caused by Bit0, bit1 etc etc. Below my suggestion
    Code:
            TRISA = 255
            TRISB = 240
            b0 var byte
    
    start:
            b0 = PORTB
            if b0.4 = 0 then trigger
            goto start
    
    trigger:
            pause 500
            b0 = PORTB
            if b0.5 = 1 then send
            goto start
    
    send:
            b0 = PORTA
            if b0.4 = 1 then eleven
            PORTB = b0
            goto start
    
    eleven:
            if b0.0 = 0 then ten
            PORTB = 11
            goto start
    
    ten:
            PORTB = 10
            goto start
            end
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. New version of Pic BASIC Pro released
    By Demon in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th March 2010, 16:41
  2. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 20:10
  3. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 15:17
  4. Picbasic Pro Demo assembly errors
    By mikeRho in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd January 2008, 07:41
  5. DT-ints-18 - new version
    By dip1 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 10th October 2007, 21:09

Members who have read this thread : 0

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