Confusion!
Iguanaman
Posts: 32
in Propeller 1
I am using the "Spin code examples for beginners (public version)". The fun example uses the LED's on the demo board to display a bitmap pattern stored in a data table. Code by Beau Schwabe (parallax). Dave Scanlan 2006-03-04. It is about in the center of the page. I typed this program in and it did not work. The start of the program douse not look right. Could someone ex plane what I am seeing. Thank you for your help. 2 feb 2019(sat)
Comments
Or post the code in the "Code" tags.
This is the page that I was referring to that has the problem with the spin code " Fun examples using the LED's on he demo board to display a bit pattern stored in a data table". Center of page. I thought that there was only one page of the help. There are a lot of pages!!!Thank you for your help. 2 feb 2019(sat)
Which Example #? And you need to post the code you typed in. Did you try and Cut/Paste code from the unzipped files?
''** 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]16..23] := %11111111 'Make I/O's 16 to 23 OUTPUTs
repeat 'Enter Endless Loop
repeat scan from 0 to 26 'Create an offset index from 0 to 26
outa[noparse][[/noparse]16..23] := 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 %00000000
byte %00010000
byte %00111000
byte %01111100
byte %11111110
byte %01111100
byte %00111000
byte %00010000
byte %00000000
byte %00000000
byte %11111111
byte %10000001
byte %10000001
byte %10000001
byte %11111111
byte %00000000
byte %00000000
byte %10000000
byte %01000000
byte %00110000
byte %00011000
byte %00000111
byte %00011000
byte %00110000
byte %01000000
byte %10000000
byte %00000000
I hope this helps. I will copy and past more often. Thank you for your help. I removed the [noparse]. 2 feb 2019(sat)
You have to move the board back and forth pretty aggressively to see the results.
Which Parallax Propeller board are you using because I see that example program uses I/O pins 16 to 23?
I also see that example is about half-way down the page and there is a SPIN file attached, which is what you should be using.
DisplayBitmapPatternVer2.spin
The listed code has some issues in addition to the [NoParse] and [/NoParse].
The constants XinFreq and ClkMode should both be in the CON section and the code should be indented for functionality and clarity.
As an example, the code to be to repeated should have at least one space under the Repeat command.
Propeller Tool will show white lines from the Repeat statement to the lines of code that will be repeated.
Much of this is explained in the Propeller Education Kit text.
OK, You first said you where using the Parallax Demo Board which has built in LED's.
Now you have to show a picture of your setup a tells us exactly what is not working.
This may sound like a stupid question but have you gotten a single LED to blink and at different rates?
And since your are using the Propeller on a breadboard it is very important that you check, double check, triple check, etc your wiring or "the magic smoke will escape".