Shop OBEX P1 Docs P2 Docs Learn Events
FlexBASIC on P1 — Parallax Forums

FlexBASIC on P1

Finally got to try this....very 😎
Love the nice clean FlexProp IDE.

I need serial, I²C, SPI, etc. Anyone successfully used existing objects?

Comments

  • yetiyeti Posts: 818
    edited 2020-11-06 14:49
    Scan the FlexProp docs for using SPIN, PASM and C with BASIC.
    Hooking FDS to BASIC's file I/O commands:
    $ cat FDS_with_BASIC.bas 
    dim ser2 as class using "spin/FullDuplexSerial.spin"
    ser2.start(31, 30, 0, 115200)
    open SendRecvDevice( @ser2.tx, @ser2.rx, @ser2.stop ) as #2
    for i=1 to 3
      print #2,"Hi! (printed via FullDuplexSerial.spin)"+chr$(13)
      pausems 100
    next i
    close #2
    
    $ /opt/propellertools/bin/flexspin -O2 FDS_with_BASIC.bas 
    Propeller Spin/PASM Compiler 'FlexSpin' (c) 2011-2020 Total Spectrum Software Inc.
    Version 5.0.0 Compiled on: Nov  1 2020
    FDS_with_BASIC.bas
    |-FullDuplexSerial.spin
    fmt.c
    strings.bas
    posixio.c
    bufio.c
    errno.c
    memset.c
    FDS_with_BASIC.pasm
    Done.
    Program size is 10196 bytes
    
    $ /opt/propellertools/bin/spinsim -b FDS_with_BASIC.binary
    Hi! (printed via FullDuplexSerial.spin)
    Hi! (printed via FullDuplexSerial.spin)
    Hi! (printed via FullDuplexSerial.spin)
    
  • yeti wrote: »
    Scan the FlexProp docs for using SPIN, PASM and C with BASIC.

    Well that's what made me aware of the possibility. I was hoping for confirmation that this works without having to find out the hard way.
  • Mickster wrote: »
    Well that's what made me aware of the possibility. I was hoping for confirmation that this works without having to find out the hard way.
    I have used monochrome and colour VGA graphics (via Spin), FullDuplexSerial.spin and lots of the C libs in BASIC. So far no I2C or SPI but I'm ॐmmmptimistic that it will work too.
  • @yeti

    Many thanks indeed. Your first reply only came up as a single line, earlier but now I see the quoted stuff :+1:
  • Surprise!
Sign In or Register to comment.