Shop OBEX P1 Docs P2 Docs Learn Events
Spin2 OBJ declaration in FlexGUI — Parallax Forums

Spin2 OBJ declaration in FlexGUI

Brand new to the Propeller 2 and its SPIN2 programming but I have programmed the Propeller 1 with SPIN. I have loaded the FlexGUI and I see in a spin2 example the notation:
obj
ser: "spin/SmartSerial"

What does the
spin/
portion of the declaration indicate? Thanks.

Comments

  • That reference happens to be to a spin sub-directory in the default library directory. Note that Spin2 -- as defined by Parallax -- is not yet fully supported by FlexGUI/FastSpin. It will be, though.
  • There is however plenty of documentation included with FlexGUI. Do take a look, and even try some things in BASIC and C as well as spin.
  • Thanks for your help. It might help newcomers if examples included comments that explain operations, objects, and so on. Here's how I revised the Charlieplex-driver demo. Feel free to use it (or not) as you wish. --Jon
    '
    ' Charlieplex-driver demo.
    ' Connect LED MATRIX accessory board to 12-pin male header marked with P32 through P39.
    ' Uses objects:
    '	charlieplex_test.spin2 from   C:..  flexgui414b\flexgui\samples\LED_Matrix 
    '	SmartSerial from              C:..  flexgui414b\flexgui\include\spin
    '
    
    CON
      _clkfreq = 180_000_000
    
    obj
      charlie : "charlieplex_text.spin2"  		'LED control
      ser     : "spin/SmartSerial"	      		'Serial I/O in .../include/spin/ folder
    
    pub main | i					' Use i as a local variable
    
        ser.start(63, 62, 0, 230_400)		'Serial pins, setting, bit rate
        ser.str(string("Charlieplex demo", 13, 10))	'Send text to Propeller terminal
     
        i := charlie.start				'Start LED Charlie-multiplex, get next-cog value
        ser.str(string("Started cog "))		'Send text to terminal
        ser.dec(i-1)				'Send cog number to terminal
        ser.str(string(13, 10, "saying hello..."))	'Send text to terminal
        charlie.str(string("Hello, world! and:"))	'Send message to LED-display object
        ser.str(string(" saying goodbye..."))	'Send text to terminal
        charlie.str(string("Goodbye?"))		'Send message to LED-display object
        repeat					'Repeat this instruction forever
    
    ' Program Charlieplex-driver demo ends.
    
  • Yes, more comments would definitely help, and thank you for doing that for this sample.
    I'll update the version in the next distribution.
Sign In or Register to comment.