Shift << >>
Hello, this is my first post, I'm having problems with vertical scroll, I can scroll up, I can not scroll down, swapped the shifft by Shift << >> but only the first number and rolled down, the second does not appear , which may be wrong.
Ay help will be appreciated thanks.
MDAWEB
Rio de Janeiro Brasil.
Ay help will be appreciated thanks.
MDAWEB
Rio de Janeiro Brasil.
xScroll_V_UP_MAX7219:
LOOKUP UltimaMarcha,[um,dois,trez,quatr,cinco,re_,neutro], UltimaUP
LOOKUP marchaatual, [um,dois,trez,quatr,cinco,re_,neutro], AtualUP
FOR row = 1 TO 9
FOR col = 1 TO 5
READ (UltimaUP + col - 1),vScroll.LowByte
READ (atualUP + col - 1),vScroll.HighByte
d7219 = vScroll >> (row - 1) ' get "frame"
SHIFTOUT Dpin,Clock,MSBFirst,[col,d7219]
PULSOUT Load,Speed
NEXT
PAUSE 600
NEXT
PAUSE 100
return
xScroll_V_DW_MAX7219:
LOOKUP UltimaMarcha,[um,dois,trez,quatr,cinco,re_,neutro], UltimaDW
LOOKUP marchaatual, [um,dois,trez,quatr,cinco,re_,neutro], AtualDW
FOR row = 1 TO 9
FOR col = 1 TO 5
READ (UltimaDW + col - 1),vScroll.LowByte
READ (AtualDW + col - 1),vScroll.HighByte
vScroll.LwByte is Scrolled
vScroll.HighByte is Blank on Display
d7219 = vScroll << (row - 1) ' get "frame"
SHIFTOUT Dpin,Clock,MSBFIRST,[col,d7219]
PULSOUT Load,Speed
NEXT
PAUSE 1000
NEXT
PAUSE 100
return
Comments
BTW the easiest way to think about the shift operators is that they double or half the left hand quantity the number of times specified by the right hand operand.
So 2 << 3 yields 16 because it can be written out as 2 * (2 * 2 * 2))
Conversely 16 >> 3 yields 2 because it can be written out as 16 / (2 * 2 * 2).
But I still do not understand what could be wrong, sorry I do not understand. as would be the solution in code?
In xScroll_V_UP_MAX7219 you have d7219 = vScroll >> (row - 1) ' get "frame" and in xScroll_V_DW_MAX7219 you have d7219 = vScroll << (row - 1) ' get "frame"
In the top case you are dividing vScoll by 1, 2, 4, 8, ..., 256 and in the bottom case you are multiplying by the same numbers. So the result deposited into d7219 is really going to depend upon what you put into vScoll and if that's what you expected when you read from the EEPROM. Are you familiar with PBasic's DEBUG statement? I would add
DEBUG "row = ", DEC row, " vScroll = ", DEC vScroll, CR
to see what's going on with that variable.
Tk's
DEFINE DEBUG_BAUD 9600
DEFINE DEBUG_MODE 1
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 7
The Virtual Terminal ISIS is configured as:
9600
8
N
1
I'm just sending this: DEBUG "UP"
Any trick? I never used this command!
Any tips, idea of what can be?
Tnk´s
If not then take a look at page 33 of the manual http://www.parallax.com/dl/docs/prod/stamps/web-bsm-v2.2.pdf
It discusses a simple hello world program and seeing the output in a serial terminal. The code is:
' {$STAMP BS2} ' {$PBASIC 2.5} DEBUG "Hello World!"
The serial terminal should be set to the same COM port you downloaded the program over, 9600 baud rate, 8 data bits, no flow control, and no parity bits.
Net Regards
Great, glad to hear it.
BTW If you edit your first post in the thread and go advanced, you can change the status to solved.
BTW = By the way
It looks like someone marked this solved.
Thank you for your attention, show the ball!!
[] '
Mauro de Amorim