Shop OBEX P1 Docs P2 Docs Learn Events
Why only 8 outputs? — Parallax Forums

Why only 8 outputs?

Eric REric R Posts: 225
edited 2006-10-06 00:11 in Propeller 1
Been playing with Beau's· code and trying to expand. I found that I didn't have an _ between the 8 bits and corrected it but yet I only get pins 8-15 flashing. What is going on with pins 1-7? Yep, read the book but still at a loss... BTW, I am using the PropStick.



''*******************************************************************************
''** Fun example uses the LED's on the demo board to display a bitmap········· **
''** pattern stored in a data table··········································· **
''*******************************************************************************
'' Coded by Beau Schwabe (Parallax).·········································· **
''*******************************************************************************
''
''······ Directions:
''······ Load the program. LED's will appear to ALL be on.
''······ Rapidly move the demo board back-n-forth.
''······ (unplug USB2SER connector first-grin·······
''···········
''
'' Other options to this program would be to use an accelerometer
'' to determine which direction/speed you are moving, and display
'' an actual message forward or backward accordingly.
· _xinfreq····· = 5_000_000········· 'Set crystal frequency to 5 MHz
· _clkmode····· = xtal1 + pll16x···· 'wind it up to 80 MHz via a X16 PLL
CON

· Rate = 50_000····················· 'Set motion rate.
VAR
PUB Message | scan
· DIRA[noparse][[/noparse]0..15] := %11111111_11111111········· 'Make I/O's 0 to 15 OUTPUTs
·
· repeat···························· 'Enter Endless Loop
··· repeat scan from 0 to 3······ 'Create an offset index from 0 to 100
···· outa[noparse][[/noparse]0..15] := Propeller[noparse][[/noparse]scan] 'Lookup byte value in data table at offset 'scan'
···· waitcnt(Rate + cnt)············ 'pause so we can see something
DAT
·············

·······································
··· Propeller byte %01010101_01010101
··············· byte %10101010_10101010
·············· ·byte %00000000_00000000

Post Edited (Eric R) : 10/5/2006 11:27:52 PM GMT

Comments

  • CJCJ Posts: 470
    edited 2006-10-06 00:00
    try changing in your data table, the data size byte to word

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Who says you have to have knowledge to use it?

    I've killed a fly with my bare mind.
  • Eric REric R Posts: 225
    edited 2006-10-06 00:11
    CJ, Thanks.

    That was it!

    I·was so caught up in the whole 00000000_00000000 thing that I didn't even look beyond.
Sign In or Register to comment.