Shop OBEX P1 Docs P2 Docs Learn Events
FlexBASIC sample programs — Parallax Forums

FlexBASIC sample programs

Here are some FlexBASIC sample programs that I plan to demonstrate at today's talk. They can be compiled/run with FlexProp 5.0.0, available from the links in my signature. Although they are designed for the P2, many of them will also work on the P1; but I haven't tested them there!

The programs are:

00_hello.bas: simplest Hello, World program
01_hello.bas: a fancier hello program which responds to input (try entering "ken" as your name)
02_blink.bas: LED blinker; pin number assumes P2-Eval board
03_blinktwo.bas: LED blinking using BASIC subroutine in another COG
04_blinkpasm.bas: LED blinking using PASM code in another COG
05_objtest.bas: uses a BASIC object to run the "control" accessory board (p2_ctrl_board.bas is the BASIC object)
06_spintest.bas: shows how to use a Spin2 object from BASIC (jm_prng.spin2 is the Spin2 object we chose, Jon McPhalen's random number generator)
07_files.bas: shows reading and writing files on PC or SD card
08_advanced.bas: shows function closures and generic programming

Comments

Sign In or Register to comment.