Hello Mus.me,
Please tell us which PIC you are using, as each is a little different, so WE may look into it's data sheet. Your code looks like it will work BUT the unknown is if your PIC has analog stuff on portB, which you have not disabled.
Hello Mus.me,
Please tell us which PIC you are using, as each is a little different, so WE may look into it's data sheet. Your code looks like it will work BUT the unknown is if your PIC has analog stuff on portB, which you have not disabled.
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.
THANKS JOE ,IM USING F84 NOW I CHANGED SOME WIRES IT WORKS, BUT IM STILL FIGHTING WITH VARIABLES ,
THIS CODE IT WORKS
DEFINE OSC 4
TRISB = 0
PORTB = 0
J VAR PORTB.5
Main:
PORTB.6 = 1
PORTB = %00100001 '
PAUSE 1
J =0
PORTB = %00111010 '
PAUSE 1
J = 0
PORTB = %00100001 ' LETTER A
PAUSE 1
J = 0
PORTB = %00111111 'SPACE
PAUSE 1
J = 0
PORTB = %00100001 '
PAUSE 1
J =0
PORTB = %00111010 '
PAUSE 1
J = 0
PORTB = %00100001 'LETTER A
PAUSE 1
J = 0
PORTB = %00111111 ' SPACE
PAUSE 1
J = 0
PORTB = %00110101 ' DOTS :
PAUSE 1
GOTO Main
END
I WANT TO USE VARIABLES
EXAMPLE
DEFINE OSC 4
TRISB = 0
PORTB = 0
J VAR PORTB.5
A VAR BYTE
B VAR BYTE
C VAR BYTE
D VAR BYTE
E VAR BYTE
F VAR BYTE
G VAR BYTE
H VAR BYTE
I VAR BYTE
Main:
PORTB.6 = 1
PORTB = A
PAUSE 1
J =0
PORTB = B
PAUSE 1
J = 0
PORTB = C
PAUSE 1
J = 0
PORTB = D
PAUSE 1
J = 0
PORTB = E
PAUSE 1
J =0
PORTB = F
PAUSE 1
J = 0
PORTB = G
PAUSE 1
J = 0
PORTB = H
PAUSE 1
J = 0
PORTB = I
PAUSE 1
GOTO Main
END
or like this
DEFINE OSC 4
TRISB = 0
PORTB = 0
TXT VAR BYTE
K VAR BYTE
J VAR PORTB
PORTA = 1
TRISA = 1
LOOP:
'IF PORTA.4 = 0 THEN GOTO MAIN
'LOOKUP K,[],TXT
FOR TXT = 1 TO 10
READ TXT,K
J = K
PAUSE 1
NEXT TXT
GOTO LOOP
END
DATA @ 1,%01101011,%01010101,%01101011_
,%01010101,%01101011,%01010101,%01101011_
,%01010101,%01101011,1
i've done PORTB.1 to 05 outputs to LEDs anoides , and ic 4017 to 9 cathodes and PORTB.0 pulse to 4017 clock and PORTB.7 to 4017 reset, i hope u understand and tell me ur ideas about the variables thanks.
PORTB = %00100001 ' LETTER A
no good when you later have
PORTB = A
Try....
Code:A VAR BYTE A = %00100001 PORTB = A
Dave
Always wear safety glasses while programming.
Hi Mus.Me,
2 things,
<b>first </b>Use Code Tags, Please.
You do this by writing the word" code "in between square brackets[write it here ] before your code, and after your code you put /code again in between square brackets, like so [/code]
<b>second</b> thing, what was the PIC you were having trouble with before?
Look at these links:
http://www.picbasic.co.uk/forum/showthread.php?t=11263
http://www.picbasic.co.uk/forum/showthread.php?t=10834
16F84 is a good fit for you right now, no extra distractions, "fighting with variables"? Oh, I see what you are saying . . .
Last edited by Archangel; - 28th July 2009 at 04:05.
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.
Code:thank u joe for help i will do it right this time lol
Last edited by Mus.me; - 29th July 2009 at 05:07.
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