Search Results
285 results found with an empty search
- General Commands
< Back General Commands hi Command hi Display a simple hello message bye Command bye Log off the JackBord. For multi user systems only. vs View Status Command vs Display the status of the JackBord Purpose Displays status information for the JackBord including the up time and the running program, etc. Syntax vs inc Increment a Value inc Increment a value Purpose This command will increment the value of the specified port or variable by one. Or, if an offset is provided by that offset. Syntax inc target offset Arguments target This is the desired port pin ie a1, c4, etc. A channel number or variable. offset The amount by which the value of the target is to be incremented. If this is omitted, a value of 1 will be used by default. Pushers Yes Examples inc a1 Increment the value of port A1 by 1 inc a1 5 Increment the value of port A1 by 5 inc /count Increment the value of the /count variable by 1 inc /count 100 Increment the value of the /count variable by 100 inc /beans ->bean_count dec Decrement a Value dec Decrement a value Purpose This command will decrement the value of the specified port or variable by 1. Or if an offset is provided by that offset. Syntax dec target offset Arguments target This is the desired port pin ie a1, c4 etc. A channel number or a variable. offset The amount by which the value of the target is to be decremented. If this is omitted a value of 1 will be used by default. Pushers Yes Examples dec a1 Decrement the value of port a1 by 1. dec a1 5 Decrement the value of port a1 by 5. dec /count Decrement the value of the /count variable by 1 dec /count 100 Decrement the value of the /count variable by 100 dec /beans -> /bean_count
- Plot Sine Wave on Show Page
< Back Plot Sine Wave on Show Page This program plots a sine wave using the Show page. Program --- Store and Plot Sine Wave. Generate the values for a sine wave, store in an array and then plot them. --- prog_vars = d/point_no 0 d/current_angle 0.0 d/sine_value 0.0 d/plot_value 0 prog_vars. prog_start = pclear print "Plot a Sone wave" prog_start. prog_loop = plot_sine 100 0.0 exitnow prog_loop. plot_sine /no_of_points 0 /start_angle 0.0 = -- Generate the sine wave data points and plot them. print "Plot /no_of_points of Sine Wave" /current_angle /start_angle -- Loop through and plot the points repeat /no_of_points -> -- Calc the sine of the /current_angle sin /current_angle -> /sine_value -- Scale the Sine wave to fit. mapf -1 1 -50 50 /sine_value -> /plot_value plot 0 50 ^id=sine^w=500^h=200^xp=/point_no ^v1=/plot_value ^title=Sine Wave^ -- Next angle inc /current_angle 0.5 inc /point_no repeat. plot_sine. prog_stop = print "Good bye" prog_stop.
- A/D Commands
< Back A/D Commands adcal - Set the A/D Converter gradient and offset values Purpose Use this to set a gradient and offset for the JackBord’s A/D converter. This will be used on all analog readings. Syntax adcal grad offset Arguments grad A floating point gradient value. offset A floating point offset value. Examples adcal 3.3 12 Notes Don’t use this unless you know what you are doing. gav - Get analog voltage reading. Returns a floating point value. Purpose Get a voltage reading from the specified port analog pin. If the min and max values are provided the output will be scled between them. If no min & max values are provided the output will be the reading from the A/D in volts. Syntax gav #~ min max Arguments #~ The pin from which to get the reading min An integer minimum value. -1000 to 1000 max An integer maximum value. -1000 to 1000 Examples 1. Just get a voltage reading from port pin A1: gav a1 The reading will be between 0V and 3.1V. 2. Scale the input voltage between 0 and 12V: gav a1 0 12.0 This means that if the input voltage is 3.1V the voltage from the JackBord will be 12V. You can use this to turn the JackBord's analog input into a voltage probe that can measure various voltage ranges. For example if you put two 10K resistors into a potential divider and feed the center into port pin A1, run this command: gav a1 0 6.2 This will have the effect of scaling the input between 0 and 6.2V and the value given by the gav command will be correct. Notes: To stop using the pin as an analog input run the gav command with the pin name and 0. eg to stop using a2 as an analog input run gav a2 0 . admax - Set the A/D Converter Max Voltage Scale Value Purpose If this is not 0 it is used to set the Max voltage that the A/D converter 4096 reading represents. Syntax admax value Arguments value A floating point voltage value, 0 to 100 Notes Don’t use this unless you know what you are doing. adwmax - Set the A/D converters ad_max_raw_value Purpose Sets the max digital reading we will get at full scale. This is usually 10 bits = 1024 12 bits = 4096 Syntax adwmax value Arguments value A positive integer value, between 1000 and 4096. Notes Don’t use this unless you know what you are doing.
- Sensors - BME280 Temperature, Relative Humidity and Pressure
< Back BME280 Temperature, Relative Humidity and Pressure This sensor allows you to measure air temperature, relative humidity and atmospheric pressure. This sensor allows you to measure air temperature, relative humidity and atmospheric pressure. This sensor uses the i2c bus on Port D of the JackBoard. The basic specifications of the sensor are shown below: Specifications Temperature: Range: -40C to +85C Accuracy: +/-0.5C Relative Humidity: Range: 0% to 100% Accuracy: +/-3% Pressure: Range: 300mb to 1100mb Accuracy: +/-1mb You can find the data sheet for the sensor below: bme280 Sensor Specifications .pdf Download PDF • 1.59MB BME280 Commands These are some commands you can use with the BME280. i2con Enable the i2c system Purpose Turn on I2c System and update config. Syntax i2con i2coff Disable the i2c system Purpose Turn off I2c System and update config. Syntax i2coff f2c Find attached i2c devices Purpose This will scan the i2c port looking for attached i2c devices. When a new device is found it will be setup. Syntax f2c Examples > f2c < Finding I2C Devices.... < Setup BME280 temp on next free chan [26] < Setup BME280 RH on next free chan [27] < Setup BME280 Pressure on next free chan [28] Found 1 devices Channels & Vars Each of the devices found will be allocated the channels the require automatically. Their readings will appear in the gt command etc. g2c Get register value from an i2c device Purpose This will get the value of the specified register from the specified i2c device address. Syntax g2c addr reg bytes Arguments addr The i2c devices address from the l2d command. 0 to 128 reg The register number from 0 to 256 bytes The number of bytes to expect back from the i2c device. 1 to 256. Pushers Yes Returns Nothing Examples > g2c 118 137 1 < g2c data 0[111] 1[0] final [111] Get reg no 137, one bytes from i2c address 118. Notes This can be used from the command line and in programs. l2c List active i2c devices & sensors Purpose Lists all of the active i2c devices connected to the JackBord’s i2c port. This will list all of the devices associated with each i2c address. Syntax l2c l2d List active i2c devices only Purpose Lists all of the active i2c devices connected to the JackBord’s i2c port. It only lists whole devices, not sub devices. Syntax l2d s2c Send data to i2c device register Purpose Send data to the specified register on the specified i2c device. All values are integers. Syntax s2c addr reg value Arguments addr The i2c devices address from the l2d command. 0 to 128 reg The register number from 0 to 256 value An integer value between 0 and 256. Pushers Yes Examples > s2c 118 137 23 ->/result Notes This can be used from the command line and in programs. v2c Show the status of the i2c system Purpose Displays the status of the i2c system including the number of devices connected and the i2c pins. Syntax v2c rsti2c Reset all i2c devices Purpose This will reset all of the i2c devices connected to the JackBord and remove them from the system. Syntax rsti2c Examples rsti2c Previous Next
- Projects - Driving Robot
< Back Driving Robot In this project, you will create a robot that can drive around using the DRIVE page on the dashboard, the command line, or a program. Once you have your wheels attached, there are three ways in which you can drive the JackBord. This project walks you through controlling the motors by using the joystick on the DRIVE page, the command line on the CMD page, and a program on the PROG page. By the end of this project, you’ll be comfortably controlling your robot, and have a good understanding of its controls. PDF INSTRUCTIONS Project Gallery
- I2C Commands
< Back I2C Commands i2con - Enable the i2c system Purpose Turn on I2c System and update config. Syntax i2con i2coff - Disable the i2c system Purpose Turn off I2c System and update config. Syntax i2coff f2c - Find attached i2c devices Purpose This will scan the i2c port looking for attached i2c devices. When a new device is found it will be setup. Syntax f2c Examples > f2c < Finding I2C Devices.... < Setup BME280 temp on next free chan [26] < Setup BME280 RH on next free chan [27] < Setup BME280 Pressure on next free chan [28] Found 1 devices Channels & Vars Each of the devices found will be allocated the channels the require automatically. Their readings will appear in the gt command etc. g2c - Get register value from an i2c device Purpose This will get the value of the specified register from the specified i2c device address. Syntax g2c addr reg bytes Arguments addr The i2c devices address from the l2d command. 0 to 128 reg The register number from 0 to 256 bytes The number of bytes to expect back from the i2c device. 1 to 256. Pushers Yes Returns Nothing Examples > g2c 118 137 1 < g2c data 0[111] 1[0] final [111] Get reg no 137, one bytes from i2c address 118. Notes This can be used from the command line and in programs. l2c - List active i2c devices & sensors Purpose Lists all of the active i2c devices connected to the JackBord’s i2c port. This will list all of the devices associated with each i2c address. Syntax l2c l2d - List active i2c devices only Purpose Lists all of the active i2c devices connected to the JackBord’s i2c port. It only lists whole devices, not sub devices. Syntax l2d s2c - Send data to i2c device register Purpose Send data to the specified register on the specified i2c device. All values are integers. Syntax s2c addr reg value Arguments addr The i2c devices address from the l2d command. 0 to 128 reg The register number from 0 to 256 value An integer value between 0 and 256. Pushers Yes Examples > s2c 118 137 23 ->/result Notes This can be used from the command line and in programs. v2c - Show the status of the i2c system Purpose Displays the status of the i2c system including the number of devices connected and the i2c pins. Syntax v2c rsti2c - Reset all i2c devices Purpose This will reset all of the i2c devices connected to the JackBord and remove them from the system. Syntax rsti2c Examples rsti2c
- SPI Commands
< Back SPI Commands spion - Enable the SPI system Purpose Turn on the SPI system. Syntax spion spioff - Disable the SPI system Purpose Turn off the SPI system. Syntax spioff spipins - Set the port pins to use for the SPI system Purpose Allows the pins to be used for the SPI system to be set. Syntax spipins SCK MISO MOSI CS Arguments SCK Port pin to be used for the SCK pin. MISO Port pin to be used for the MISO pin. MOSI Port pin to be used for the MOSI pin. CS Port pin to be used for the CS pin. Examples spipins c2 c3 c4 c5 Setup port C pins 2 to 5 to be the SPI port pins. Notes The port B and E pins cannot be used for SPI. spot - Set the Resistance value of the MCP4161 Digital Potentiometer Purpose Set the Resistance value of the MCP4161 Digital Potentiometer which is connected to the SPI port. Syntax spot value Arguments value Digital pot value between 0 and 255. Examples spot 50 Notes Connection to JackBord SPI Port on Port C. vspi - Display the status of the SPI system Purpose Displays the status and basic settings of the SPI port system. Syntax vspi
- PWM Commands
< Back PWM Commands lpwc - List the PWM system channel allocations Purpose List the PWM channel allocations on the esp32. The esp32 can handle a maximum of 6 pwm chans. Syntax lpwc lpwi - List the PWM system settings info Purpose Display the settings being used by the PWM system. Syntax lpwi mfreq - Set PWM freq for the Drive Motors Purpose This sets the pwm frequency for the main drive motors. NOTE: the updated freq gets picked up by the relevant functions. Syntax mfreq freq Arguments freq The frequency to use for the pwm main drive system. 50 to 5000Hz. pfreq - Set PWM freq for the I/O Ports Purpose This sets the pwm freq for the pwm command. Syntax pfreq freq Arguments freq The frequency to use for the pwm system. 50 to 5000Hz. pwm - Pulse width modulation on a pin Purpose pwm allows a pulse width modulated (PWM) signal to be applied to a pin. Syntax pwm #~ duty Arguments #~ The port letter a, b, c, d and pin number 1 to 5. eg a1 or c4 duty The duty cycle from 0 to 100. Pushers No Returns Nothing Examples pwm a1 50 Set pin a1 at 50% pwm d1 75 Set the USER LED at 75% brightness pwm a3 /speed Use the /speed variable to set the pwm duty on pin a3
- sled Example Light Program
< Back sled Example Light Program This program works with a single smart RGB led on the TOP. Connect the SLEDs data pin to the SLED pin on port E (pin E1 in some models). It randomly changes the colour of the LED. Program --- sled Example Light Program This program works with a single smart RGB led on the TOP. Connect the SLED's data pin to the SLED pin on port E (pin E1 in some models.) It randomly change the color of the LED. --- prog_vars = d/count 0 d/color 0 prog_vars. prog_start = print "Program Start" -- Set the number of LEDS sledn 1 prog_start. prog_loop = -- main program loop print "Count /count" inc /count any /count >= 1000 -> exitprog -- Set a random color rand 0 15 -> /color -- Set the led sled 1 /color d100 prog_loop. prog_stop = print "Bye" prog_stop.
- Trigonometry: Calculate the Area of a Triangle
< Back Trigonometry: Calculate the Area of a Triangle Trigonometry: Calculate the Area of a Triangle. Use of Sine function to find area of triangle. This program uses radians for the input angles. Program --- Trigonometry: Calculate the Area of a Triangle Use of Sine function to find area of triangle This program uses radians for the input angles. By Geoff Fellows --- prog_vars = d/length1 0.0 d/length2 0.0 d/degrees_angle 0.0 d/radians 0.0 d/area 0.0 d/raw_sine 0.0 d/pi 0.0 prog_vars. prog_start = "Calculate the area of a triangle using the Sine function" "You need the length of two sides and the angle joining them" div 22 7 -> /pi -- the input sine function expects radians not degrees -- which means we will convert the angle to radians prog_start. prog_loop = "Enter length one and two and the angle" getline -> /length1 getline -> /length2 getline -> /degrees_angle "/length1 /length2 /degrees_angle" -- convert degress to radians div /degrees_angle 180 -> /radians mul /radians /pi -> /radians "/degrees_angle degrees = /radians radians" sin /radians -> /raw_sine mul 0.5 /length1 /length2 /raw_sine -> /area "=================================" "Print the area of the triangle is /area" exitprog prog_loop. prog_stop = print "Good bye" prog_stop.
- Capacitor Charge Discharge Plot
< Back Capacitor Charge Discharge Plot Use a 100K Resistor with a 10uF capacitor. Use A1 to monitor the capacitor voltage. A2 charges the capacitor. Program --- Capacitor Charge Discharge Plot Program Use a 100K Resistor with a 10uF capacitor. Use A1 to monitor the capacitor voltage. A2 charges the capacitor. --- prog_vars = d/count 0 prog_vars. prog_start = pclear d1000 ptl 10 5 ^ts=24^ "Capacitor Program" gvr a1 0 100 a2 0 ptl 10 50 "Wait for Disacharge" dly 3000 ptl 10 50 ^tc=lime^ "Charge" a2 1 plot 10 100 ^xp=/count ^n=A1 Volts^v1= /a1 ^ prog_start. prog_loop = plot 10 100 ^xp=/count ^v1= /a1 ^ inc /count any /count >= 100 -> exitprog dly 25 -- Discharge any /a1 >= 95 -> /a2 0 ptl 10 50 ^tc=red^ "Discharge" enda. prog_loop. prog_stop = ptl 10 50 ^tc=red^ "Finished" a2 0 prog_stop.
- Nested Ant Test
< Back Nested Ant Test This program is to test the ability of Octagon to handle nested ant commands. Program --- Nested Ant Test Program 1 This program is to test the ability of Octagon to handle nested ant commands. --- prog_vars = d/a 0 d/b 0 d/c 0 d/run_no 0 prog_vars. prog_start = print "Nestedt Ant Test Program" rdbg 6 prog_start. prog_loop = "MMMMMMMMMMM MAIN run /run_no MMMMMMMMMMM" ant /run_no -> = 1 -> task1 /run_no = 2 -> task2 /run_no = 3 -> task2 /run_no -> default_task /run_no ant. "POST ANT" inc /run_no any /run_no > 5 -> exitprog prog_loop. task1 /t1_runs 0 = "ENTER T1" patdog 1 tg c1 ant /t1_runs -> = 1 -> "T1 Run 1" = 2 -> "T1 Run 2" -> "T1 Defaiult /t1_runs" ant. patdog 2 "EXIT T1" task1. task2 /t2_runs 0 = tg c2 "ENTER T2" ant /t2_runs -> = 1 -> "T2 Run 1" = 2 -> "T2 Run 2" = 3 -> "T2 Run 3"|task3 /t2_runs -> "T2 Defaiult /t2_runs" ant. "EXIT T2" task2. task3 /t3_runs 0 = "ENTER T3" tg c3 ant /t3_runs -> = 1 -> "T3 Run 1" = 2 -> "T3 Run 2" = 3 -> "T3 Run 3" -> "T3 Defaiult /t3_runs" ant. "EXIT T3" task3. default_task /d_run_no 0 = "ENTER default_task run /d_run_no" "EXIT default_task run /d_run_no" default_task. prog_stop = -- max /numarray[*] -> /maxnum -- print "the maximum number is /maxnum" print "bye" prog_stop. --- The peogram should produce this output: Nestedt Ant Test Program MMMMMMMMMMM MAIN run 0 MMMMMMMMMMM ENTER default_task run 0 EXIT default_task run 0 POST ANT MMMMMMMMMMM MAIN run 1 MMMMMMMMMMM ENTER T T1 Run 1 EXIT T1 POST ANT MMMMMMMMMMM MAIN run 2 MMMMMMMMMMM ENTER T2 T2 Run 2 EXIT T2 POST ANT MMMMMMMMMMM MAIN run 3 MMMMMMMMMMM ENTER T2 T2 Run 3 ENTER T3 T3 Run 3 EXIT T3 EXIT T2 POST ANT MMMMMMMMMMM MAIN run 4 MMMMMMMMMMM ENTER default_task run 4 EXIT default_task run 4 POST ANT MMMMMMMMMMM MAIN run 5 MMMMMMMMMMM ENTER default_task run 5 EXIT default_task run 5 POST ANT bye ---
- Logic Input Detector
< Back Logic Input Detector This program turns Port A pins a1 and a2 into logic inputs with pullup resistors so that they are naturally at logic level 1. Shorting them to ground will make them 0. We use the any statement to detect when they are low. Program --- Logic Input Detector This program turns port A pins a1 and a2 into logic inputs with pullup resistors so that they are naturally at logic level 1. Shorting them to ground will make them logic level 0. We use the any statement to detect when they are low. --- prog_vars = d/count 5 prog_vars. prog_start = print "Setup Program" /d1 0 -- Set Port A1 & A2 as inputs with pullups spm a1 1 spm a2 1 prog_start. prog_loop = -- Check if pin A1 is Low, turn User Led off any /a1 = 0 -> /d1 0 -- Check if pin A1 is High, turn User Led on any /a1 = 1 -> /d1 1 -- Check if pin A2 is Low, turn C1 off any /a2 = 0 -> c1 0 enda. -- Check if pin A2 is High, Turn C1 on any /a2 = 1 -> c1 1 enda. prog_loop. prog_stop = print "Bye" prog_stop.
- Plot Brightness from an LDR on Port B1
< Back Plot Brightness from an LDR on Port B1 This program plots the brightness readings from an Light Dependent Resistor (LDR) connected to port B1 of the JackBord. The circuit is the LDR, one wire conennected to the 3V power on port B and the other one is attached to port B1. A 100K resistor goes from B1 to ground. Program --- Plot Brightness from an LDR on Port B1 --- prog_vars = d/brightness 0 prog_vars. prog_start = print "Plot Light Level from LDR on Port B1" gvr b1 0 100 /brightness 0 prog_start. prog_loop = -- Scale the LDR brightness from 0 to 100 to 0 to 50 -- so it fits in the plot. mapi 0 100 0 50 /b1 -> /brightness -- Plot the LDR Brightness -- Put a max line at 50 tbar B /brightness 50 20 "/b1 = /brightness" d250 prog_loop. prog_stop = print "Good bye" prog_stop.
- Random Light Flasher Using the rand and toggle Commands
< Back Random Light Flasher Using the rand and toggle Commands This program uses the rand and toggle commands to randomly flash LEDs connected to port A. The rand command generates a number between 1 and 5 and stores it in the /rand_no var. The tg (toggle command) then uses the /rand_no as an argument to toggle the corresponding led on port A. This is possible because the toggle command uses channels. Program --- Random Light Flasher Program using the rand and toggle comamnds This program uses the rand and toggle commands to randomly flash LED's connected to port A. The rand command generates a number between 1 and 5 and stores it in the /rand_no var. The tg (toggle command) then uses the /rand_no as an argument to toggle the corresponding led on port A. This is possible because the toggle command uses channels. --- prog_vars = d/runs_to_do 50 d/runs_done 0 d/rand_no 0 prog_vars. prog_start = aoff prog_start. prog_loop = -- Do /runs_to_do runs repeat /runs_to_do -> -- Get a random number rand 1 15 -> /rand_no "rand no /rand_no run no /runs_done" -- Toggle the value of the channel no in the /rand_no var tg /rand_no repeat. -- dec the runs to do and inc runs done dec /runs_to_do inc /runs_done -- exit after runs done any /runs_done >= /runs_to_do -> exitprog prog_loop. prog_stop = -- Turn the port A Leds off aoff print "Bye" prog_stop.
- Random Number Test
< Back Random Number Test This program shows you how to use the rand, random number generator command. It will generate a random number between zero and five each time the main program loop runs. If the number generated is 4 the program will exit and print BOOM!. You can use random numbers in programs where you want an event to occur at an unpredictable time. When the program runs it will exit after a random interval. This interval is dependent on how quickly the number 4 arises in the random number sequence. Program --- Random Number Test Program This program will generate a random number between zero and five. It Will wait until the number four comes up and then exit. --- prog_vars = d/count 1 d/randno 0 prog_vars. prog_start = print "Random Number Test Program" prog_start. prog_loop = rand 0 5 -> /randno print "Count /count rand /randno" any /randno = 4 -> "BOOOM!"|exitprog inc /count prog_loop. prog_stop = print "Prog STOPPED!" prog_stop.
- RC Servo Simple Claw
< Back RC Servo Simple Claw This program uses an RC Servo on port pin A1 as a claw to grip toilet rolls. Create an open and close button on the show page. Open angle is 0 degrees and closed angle is 60 degrees. Program --- RC Servo Demo 3 Program: Simple Claw This program uses an rc servo on port pin A1 as a claw to grip toilet roles. Create an open and close button on the show page. Open angle is 0 deg Closed angle is 60deg tmt3NneW --- prog_vars = d/run_no 0 d/claw_angle 0 prog_vars. prog_start = pclear ptl 10 0 ^ts=25^tc=red^ "RC Servo Demo 3: Simple Claw" -- open the claw by default. svp a1 0 -- Display the buttons pb 100 100 ^n=Open^p=svp a1 0^ pb 200 100 ^n=Close^p=svp a1 60^ -- Display the quit button pb 300 100 ^n=Quit^p=exitprog^ prog_start. prog_loop = -- Waste time patcat prog_loop. prog_stop = print "Bye" ptl 200 200 ^ts=45^ "Bye" svp a1 0 prog_stop.
- Button Commands
< Back Button Commands bp - Simulate a button press Purpose Simulates a button press on a given pin. This is used for the GCC version of Octagon or where a physical button is not available. Syntax bp #~ Arguments #~ The port letter a, b, c, d and pin number 1 to 5. eg a1 or c4 Examples bp a1 bp c4 Notes This can be used from the command line and in programs. Channels & Vars Updates the corresponding channel. br - Simulate a button release Purpose Simulates a button release on a given pin. This is used for the GCC version of Octagon or where a physical button is not available. Syntax br #~ Arguments #~ The port letter a, b, c, d and pin number 1 to 5. eg a1 or c4 Examples br a1 br c4 Notes This can be used from the command line and in programs. Channels & Vars Updates the corresponding channel. btd - Set the button debounce delay in milli seconds Purpose Sets the debounce delay for buttons. Syntax btd delay Arguments delay The debounce delay in milli seconds. 50 to 250. Examples btd 50 Notes Use with pins set as buttons. btg - Get the state of a button Purpose Gets the state of the specified button Syntax btg #~ Arguments #~ The port letter a, b, c, d and pin number 1 to 5. eg a1 or c4 Examples > btg a1 < Btg button chan[1] pin [a1] State [1] 1 = pressed btp - Set a button press event Purpose Set a command/s that should be run when the specified button is pressed. Syntax btp #~ command/s Arguments #~ The port letter a, b, c, d and port pin number 1 to 5 command/s One or more commands that should be run when the button is pressed. Commands may be daisy chained. Examples btp a1 “Hi from button 1” btp a2 d1 1|d500|d1 0 Notes This can be used from the command line and in programs. Drive Page Buttons: The drive page buttons 1 to 9 are virtual buttons and are on port v ie v1 to v9. eg btp v1 “Hi from drive button 1” btr - Set a button release event Purpose Set a command/s that should be run when the specified button is released. Syntax btr #~ command/s Arguments #~ The port letter a, b, c, d and port pin number 1 to 5 command/s One or more commands that should be run when the button is released. Commands may be daisy chained. Examples btr a1 “Bye from button 1” btr a2 d1 1|d500|d1 0 Notes This can be used from the command line and in programs. Drive Page Buttons: The drive page buttons 1 to 9 are virtual buttons and are on port v ie v1 to v9. eg btr v1 “Bye from drive button 1” lb - List buttons Purpose Display a list of the currently active buttons. Syntax lb lbc - List button commands Purpose Display a list of the commands required to reproduce the currently set buttons. Use this to backup button settings. Examples > lbc < Button Commands btp a1 "Button press a1" btr a1 "Button release a1" rstb - Reset all buttons Purpose reset all of the set buttons.
- L298 H-Bridge Commands
< Back L298 H-Bridge Commands clr298 - Clear L298 Bridge Settings to Defaults Purpose This will disable the l298 bridges and return the Port C & D pins to their defaults. Syntax clr298 con298 - Control an L298 H-Bridge Purpose Allows the specified L298 H-bridge to be controlled. The direction and speed of each half of the bridge may be set. Note: The L298 H-Bridge must be connected to the JackBord as follows: L298 JackBord L298 ENA1 (PWM signal) C1 L298 IN1 C2 L298 IN2 C3 L298 ENA2 (PWM signal) C4 L298 IN3 C5 L298 IN4 D1 Syntax con298 bridge motor speed Arguments bridge The number of the bridge to control. 1 or 2. motor The number of the motor on the bridge to control. 1 or 2. speed The speed to be applied to the specified motor. The speed is between -100 and 100. 100 = Full forwards speed 0 = Stop -100 = Full reverse speed Examples con298 1 1 100 Full forward speed on motor 1 on bridge 1. l298 - List the L298 bridge settings Purpose Shows the settings of the L298 bridges. Syntax l298 p298 - Pulse L298 H-Bridge Purpose Pulse the specified l298 h-bridge no for the no of pulses with each separated by a delay in msecs. Note: The L298 H-Bridge must be connected to the JackBord as follows: L298 JackBord L298 ENA1 (PWM signal) C1 L298 IN1 C2 L298 IN2 C3 L298 ENA2 (PWM signal) C4 L298 IN3 C5 L298 IN4 D1 Syntax p298 B M P L D Arguments B The number of the bridge to control. 1 or 2. M The number of the motor on the bridge to control. 1 or 2. P The number of pulses to send. L The length in milli-seconds of each pulse. D The delay in milli-seconds between each pulse. Examples p298 1 1 5 75 100 Pulse motor 1 on bridge 1 with 5 pulses each 75ms wide and with a 100ms delay between pulses. rst298 - Reset L298 Bridge Settings to Defaults Purpose Reset the l298 bridges and disable them. Syntax rst298 sap - Set Linear Actuator Position Purpose This command will set the specified linear actuator shaft to the specified position. Syntax sap B M pos Arguments B The number of the bridge to control. 1 or 2. M The number of the motor on the bridge to control. 1 or 2. pos The position of the END of the shaft from its fully closed position. Examples p298 1 1 5 75 100 Pulse motor 1 on bridge 1 with 5 pulses each 75ms wide and with a 100ms delay between pulses. Notes The width in pulses of the actuators full draw must be established beforehand to avoid damage. The actuator should be of the type that automatically stops at each end of its extension. apid - Set the Wifi access point SSID to use in World mode Purpose Sets the Wifi access point SSID that the JackBord will try to connect to when it boots into World mode. Syntax apid SSID Arguments SSID The Wifi access point SSID. From 1 to 30 characters. Examples apid Tree Set the SSID to Tree apid Big Fat Cat Set the SSID to Big Fat Cat appw - Set the Wifi access point password to use in World mode Purpose Sets the Wifi access point’s password of the access point the JackBord will try to connect to in World mode. Syntax appw password Arguments password The Wifi access point password. From 8 to 20 characters minimum. Examples appw fish eat frogs Set the access point password to fish eat frogs fuserap - Force the use of the user set Wifi access point. Purpose If its set to 1 this means we want to force the JackBord to use the SSID set in the var even though the JBHub access point may also be available. Syntax fuserap value Arguments value 0 = Don’t force the use of the users ap. 1 = Yes do force the use of the users ap Examples fuserap 0 fuserap 1 hget - Do an http request to the specified URL Purpose This will do an http GET request to the specified URL and store the results in the output variable, which must be of a text type. Syntax hget “URL” -> result Arguments “URL” The http URL, in “” quotes to which the GET request is to be made. result This is a text variable that holds the result of the get request. Examples hget “www.google.com” -> /result
- Ski Ramp
< Back Ski Ramp Measure how long it takes a ball to role down a ramp. Setup the ramp so that the first gate goes to B1 and the second to B2. Program --- Ski Ramp Program Measure how long it takes a ball to role down a ramp. Setup the ramp so that the first gate goes to B1 and the second to B2 --- prog_vars = d/count 0 d/start_time 0.0 d/stop_time 0.0 d/interval 0.0 d/results[10] 0.0 d/run_no 0 prog_vars. prog_start = pclear print "Ski Program Start" -- Setup the gates get b1 get b2 btp a1 calc_time btp a2 display_results prog_start. prog_loop = -- main program loop inc /count any /count >= 10000 -> exitprog prog_loop. calc_time = inc /run_no sub /s_atb2 /s_atb1 -> /interval print "Ball run /run_no interval /interval" -- Store the result /results[/run_no] /interval calc_time. display_results = print "Ski Results" /run_no 1 repeat 10 -> print "run /run_no time /results[/run_no]" inc /run_no repeat. display_results. prog_stop = print "Bye" prog_stop.

