BasicX Examples
 
 
 
BasicX Code Examples
 
 
This page contains example code for all BasicX products. The first section contains examples provided by NetMedia which are sorted by product. The second section contains BasicX examples provided by your fellow BasicX users.
 
If you would like to contribute please send your BasicX example to Support@BasicX.com
 
     
     
     
BasicX-24/24p & BasicX-35 Filename
  
   
Controlling a HD44780 based Parallel LCD
Adding a Timeout to InputCapture
Deriving Acceleration data from a GPS
Using block data objects with PlaySound
Using the Serial 2x16 LCD with BX-24
Input Multiplexing with the BX-24
Using a 74HCT259 Latch with the BX-24
Reading a Garmin GPS with the BX-24
Using the Sharp GP2D12 Infrared Ranger
Sharp GP2Y0A02YK Long Range Version
Reading buttons and switches
Using Polaroid ultrasonic rangefinders
Reading a 4 x 4 matrix keypad
Measuring resistance with ADC
Measuring resistance with RCtime
Controlling hobby servos
Measuring acceleration with ADXL202
Reading IR remote controls
Reading IR using serial input
Low power operation using CPUsleep
Programming Timer1 for edge capture
Programming Timer1 as a stopwatch
Dual PWM in background using Timer1
The BX-24 6 Day 8 channel data logger
Controlling the Servo8T with BX-24
   
  LCDX
   
LCDX Demo Program 1
LCDX Demo Program 2
   
  BasicX-01
   
Adding a Timeout to InputCapture
Deriving Acceleration data from a GPS
Input Multiplexing with the BX-01
Reading a Garmin GPS with the BX-01
ADXL202 accelerometers
Using hardware interrupts
Block data classes
Interfacing buttons and switches
Interfacing an IR decoder
Interfacing hobby servos
Interfacing a 4x4 matrix keypad
Measuring resistance with RCtime
Low power operation using CPUsleep
Programming Timer1 for edge capture
Programming Timer1 as a stopwatch
Dual PWM in background using Timer1
   
  Serial 2x16
   
BX-24 example program for Serial 2x16
   
  Servo 8T
   
A Windows example program
Source code for Windows example porgram
Controlling the Servo8T with BX-24
   
     
 
User contributed examples
 
File Name
Contributor
     
LCDX_Pulse_Fire.zip
NetMedia
 
Uses the LCDX and keypad to send a user defined pulse out an I/O pin.
 
LCDXSerialZ.zip
NetMedia
Serial example program looks for an upper case "Z" to trigger an event
BX-24RemoteIO.zip
NetMedia
Use VB6 to serially control the outputs of a BX-24
BX24_DS1302.zip
wizdd
DS1302 Real Time Clock Interface
BX24toPC.zip
wizdd
Data Transfer PC to/from BX-24
CStrF.bas
eric_seale
Very low RAM usage single-to-string conversion function
Com1DirectIO.bas
twesthoff22406
DebugInput (& DebugPrint) functions to allow string and byte input through Com1 without using "queue's" (Based on SerialOutString.bas)
DS18B20.zip
tfintlan
Searches the one-wire bus for up to ten DS18B20 sensors, reads the temperature and displays it on the screen
DateTimeNMEA.zip
b19063
GPS NMEA Sentence Parsing
EasyOpenSPI.bas
NetMedia
An easier-to-use version of OpenSPI
FlushSerialPort.bas
NetMedia
Flushes serial port
SonyPSController.zip
NetMedia
Read Sony Playstation 2 controllers with BX-24
InputCapture.zip
depoebaybob
Variable resolution InputCapture (with timeout) used to capture all 8 channels of R/C PPM signal
Makblk.zip
mmcdade5841
 
Make Block Data from ASCII File
 
PID 1.1.zip
biovirus1
 
PID code for BX24
 
 
PalmNewDeBug.zip
cyberbiota
 
Two-way BX 24 to Palm serial comms application
 
 
ProtenseCode.zip
oruivo
 
I2C Routines from Harry White
 
QueueDemo.zip
NetMedia
Queue demo in BasicX and VB
RS485_and_BX24.doc
neil_jepsen
RS485 & the BX24
Simple code to generate a CRC using the BX24.doc
neil_jepsen
CRC simple code for generating a CRC
SerialOutString.bas
NetMedia
Debug.Print with variable baud
StrComp.bas
NetMedia
String comparison function
 
StringSearch.bas
NetMedia
 
Emulation of VB's InStr function
 
USING THE CD4021 SHIFT REGISTER TO EXPAND THE BX24 INPUTS.doc
neil_jepsen
 
Expanding BX24 inputs and outputs
 
VBtoBXdemo.zip
NetMedia
 
Exchange data between BasicX and Visual Basic (ALL Source included).
 
RS232scopeV1.zip
  Microsoft Excel RS232 sample program
bxTokenizer.zip
NetMedia
  BasicX tokenizer
com_to_excel.zip
trbrenke
  VB6 program.Com port to excel. cell seperations are done with chr(13). mod-2
fm_schematic.gif
wn0x
  Frequency measurement schematic
lcd6pin.zip
mariovc
 
Subroutines to connect a LCD HD44780 to BX-24 using 6 pins
numconvert.zip
trbrenke
 
convert between integer hex & bin
servosub.zip
trbrenke
 
code for working with the ft649 + ft639 servo control chips. 25 servos max
source.zip
trbrenke
 
com-excel source code
vb_FastStrings.zip
xwisdom
  VB Fast String Object - process strings faster in VB  
SPIUtils.bas
wolfchild76
Pot-based voltage output
SPI_Analog _Out.gif
wolfchild76
Pot-based voltage output
SPI_Analog_In.gif
wolfchild76
MAX147 8-ch, 12-bit SPI analog input
SPI_Digital _In.gif
wolfchild76
32-bit expandable SPI digital input
SPI_Digital_Out.gif
wolfchild76
32-bit expandable SPI digital output
Kronos Robotics Serial Backpack and ADC example code.zip
slopesailer
BX24 Kronos Serial LCD BP and ADC example code: well documented
BasicXScripts.zip
mlinnen
Windows Scripts to aid in command line compiles
BX01QRef.doc
BX-01 Quick Reference (Word) Document
co_talk.bas
Demonstrates coprocessor communication for ARobot
wanderbx.bas
Wander routine for ARobot
Basicx.lbr
BX-24 Eagle3.5 Component
BitOps.bas  
Bit-wise operations on bytes and arrays
DS1267.bas
sgezerlis
BX-24 controlling DS1267 digital potentiometer subroutines
DS1620.bas
hylander_ii
DS1620 BasicX-24 Code
Dallas1820.bas
hylander_ii
DS-1820 Interface Module (uses Dallas1Wire.bas)
Dallas1Wire.bas
hylander_ii
1-Wire Interface Module
Dallas1WireTest.bas
hylander_ii
1-Wire Example (uses Dallas1820.bas)
DevantechW.bas
Demo I2C reads Devantech compass. Read direction as 2 bytes
devantech.bas
Miked
Demo I2C reads Devantech compass. Read direction as byte
EasyLCD.bas
Easy way of trying out LCD communication - I modified the BX24 demo program and used Parallax BOE
GD2D02.bas
GP2D02 Ir Ranging
I2C-v2.bas
darsys68
  I2C.bas for sending and receiving via an I2C interface. This is just the routines for I2C so you can add them to your project and use them as required.  
LCDMOD.bas  
  Scott Edwards (aka SeeTron) LCD Module. Tested with ILM-216  
LCD_595.bas  
  74x595 to LCD (interface connections and code)  
LCD_Demo595.bas
 
  BX-24 to 74x595 to LCD  
LCD_Main.bas
 
  High level LCD routines (converted SerialPort.bas)  
Mobot.bas
viropath
  BX24 robot code  
MyLCD.bas  
  Running an LCD via SPI  
Optrex.bas
nordzipple
  Some routines for driving a Hitachi HD44780 based Optrex LCD display  
PICnLCD.BAS
  PICnLCD support for the BX-24
PID.bas
nordzipple
 
Unfinished! A PID 4-button user interface and LCD routines. Posted for multitasking code analysis
PID2.bas
nordzipple
 
Unfinished! But illustrates "stack flattening" for multitasking. Compare to PID.BAS which won't multitask on a barebones BX24
PWMServo.bas
hylander_ii
 
Code for controlling 2 servos using the hardware PWM
PWMServo.txt
hylander_ii
 
Short Description for above
bx_ext_functions.zip
xwisdom
 
Some Extended function for the BX24
fmt.bas
 
formatted input and output
fmt0_1.bas
 
includes preliminary floating input
md05.bas
darsys68
 
Module for the control and query of an MD05 motor controller. I2C-v2.bas (is required).
ping.bas
daughtrey2000
 
Ping and ARP via CS8900A ethernet controller
toggle.bas
ian_casey02
 
toggle output pin level and POWB (byte POW function)
winBXB.zip
 
A windows console app that creates binary files for BX24
 
 


User's Guide Contact BasicX Links News Features