PropBasic - INCLUDE
camelot2
Posts: 54
hi, I am trying to add some spin code to a PropBasic file with out any luck.
The code I want to add is to generate a frequency on P0. So I put together a
test_setreg.spin file as follows:
CON
pub start··· {setreg· }
··· ctra[noparse][[/noparse]30..26] := %00100 ' Set ctra for "NCO single-ended"
··· ctra[noparse][[/noparse]5..0] := 0 ' Set APIN to P0
··· frqa := 112_367 ' 0=Don't send a tone yet.
··· dira[noparse][[/noparse]0]~~ ' I/O pin to output
When I include test_setreg.spin in my PropBasic file (test_INCLUDE.pbas attached) and then compile there are numerous compile errors. If I comment out the line to include the .spin file it the compiles with no errors.
Any help as to what I am doing wrong will be greatly appreciated. thank you
The code I want to add is to generate a frequency on P0. So I put together a
test_setreg.spin file as follows:
CON
pub start··· {setreg· }
··· ctra[noparse][[/noparse]30..26] := %00100 ' Set ctra for "NCO single-ended"
··· ctra[noparse][[/noparse]5..0] := 0 ' Set APIN to P0
··· frqa := 112_367 ' 0=Don't send a tone yet.
··· dira[noparse][[/noparse]0]~~ ' I/O pin to output
When I include test_setreg.spin in my PropBasic file (test_INCLUDE.pbas attached) and then compile there are numerous compile errors. If I comment out the line to include the .spin file it the compiles with no errors.
Any help as to what I am doing wrong will be greatly appreciated. thank you
Comments
You cannot run spin code from PropBASIC. Well you can if you use a method like the "dispatch" demo program.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·