Here is what your code is doing

Originally Posted by
malwww
hello joe i wrote this code now it works the 7segment and shiftout .but when i vary things it doesnt works and it doesnt show me things, i want to know where i put a variables and how, is pic cant run 2 things in the same times ? (variables and shiftout with digit out) and i keep the shiftout how it is now , please help now it show me 3210 on leds 7segments ,sorry i cant find lcds in my country and i cant send money to buy from europ or usa bcz they dont alow us to send money out, i need to call my friends in spain to buy me them but it will take long 'now im new in pbp i want to learn a bit good and sorry about my english , thank you joe
' I2CREAD and I2WRITE Commands
Include "modedefs.bas"
'DEFINE SHIFT_PAUSEUS 1
DEFINE OSC 4
SDO VAR PortB.0
SCLK var PortB.1
DPIN var PORTA.0
CPIN var PORTA.1
B0 var byte
B1 var byte
B2 var byte
B3 var byte
B4 var byte
symbol Digit_1 = portb.4 <font color=red> renaming portb.4 to Digit_1, These can only hold the value 1 or 0</font color>
symbol Digit_2 = portb.5
symbol Digit_3 = portb.6
symbol Digit_4 = portb.7
SCLK = 8 <font color=red> attempt to give portb.1 the value of 8 ???</font color>
TRISB = 0 <font color=seagreen> set all port b as outputs</font color>
' i did a variable here lookup or read but it dont work or shiftout,
main:
Digit_2 = 1 <font color = blue> Make renamed ports HIgh. </font color>
Digit_3 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[252]
Digit_1 = 0
pause 1
Digit_1 = 1
Digit_3 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[96]
Digit_2 = 0
pause 1
Digit_1 = 1
Digit_2 = 1
digit_4 = 1
SHiftOUT SDO,SCLK,0,[218]
Digit_3 = 0
pause 1
Digit_1 = 1
Digit_2 = 1
digit_3= 1
SHiftOUT SDO,SCLK,0,[242]
Digit_4 = 0
pause 1
goto main
end
You need to put in the REQUIRED code to disable analog stuff for your chosen PIC too or it will not do the digital dance. You need to define the TRISA values to make the proper ports inputs or outputs.
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