
Originally Posted by
damu
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 09: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.
Bookmarks