top of page

Search Results

285 results found with an empty search

  • Button Task

    This program displays a button on the Show page and displays the number of times it has been pressed in real time. It runs a task called b_press each time the button is pressed. < Back Button Task This program displays a button on the Show page and displays the number of times it has been pressed in real time. It runs a task called b_press each time the button is pressed. Program --- Button Task Program --- prog_vars = d/count 0 prog_vars. prog_start = pclear print "Button Task Program Start" -- Set button to run b_press task when pressed. pb c c ^p=b_press^n=Run Task^ b_press prog_start. prog_loop = -- main program loop patdog prog_loop. b_press = inc /count ptl c d "Button Presses /count" b_press. prog_stop = print "Bye" prog_stop.

  • Simple WiFi Signal Dial with an RC Servo

    This is the program for the Simple Wifi Signal Dial with an RC Servo, which is used in it's respective project as well as activity 4001-act11. This is what makes the WiFi signal control the servo arm < Back Simple WiFi Signal Dial with an RC Servo This is the program for the Simple Wifi Signal Dial with an RC Servo, which is used in it's respective project as well as activity 4001-act11. This is what makes the WiFi signal control the servo arm Program --- Simple Wifi Signal Metre with an RC Servo 4001-act11 --- prog_vars = d/run_no 0 d/arm_angle 0 prog_vars. prog_start = pclear "4001-act11 Simple Wifi Signal Metre with an RC Servo Program" svp a1 0 prog_start. prog_loop = -- Calc the arm angle. mapi -90 -30 0 180 /s_wifisig -> /arm_angle -- Set the servos arm svp a1 /arm_angle -- Display the Wifi Signal Strength "Run /run_no Wifi signal /s_wifisig Arm /arm_angle" inc /run_no prog_loop. prog_stop = print "Bye" svp a1 0 prog_stop.

  • Sensors - Infrared Obstacle Avoidance

    This unit will detect the presence of objects at distances of between about 2cm to 30cm. < Back Infrared Obstacle Avoidance This unit will detect the presence of objects at distances of between about 2cm to 30cm. The Infrared Obstacle Avoidance Sensor will detect the presence of objects at distances of between about 2cm to 30cm. It uses an infrared emitting diode to send out an IR signal. Should the signal hit a nearby surface, it will be reflected back to the sensor and the output will go low or to 0V. The potentiometer is used to adjust the sensitivity of the sensor. Turning it anticlockwise will reduce the detection range so it detects closer objects, turning it clockwise increases the sensitivity and it will detect objects farther away. How the Sensor Works The output pin is normally low and will go high when a person or an animal crosses the sensors beam. This beam is like a 100-degree-wide fan centered along the axis of the sensor looking out from the white dome. Note: Once the sensor is triggered it will take about 8 to 10 seconds for it to reset. Sensor Pins The table below lists the pins of the sensor. Connecting the Jumpers to the Sensor First we will connect the jumpers to the sensor. Then, we will connect it to the JackBord. The sensor needs a 5V supply to work. It needs 3 female to female jumper wires to connect to the JackBord. The output of the sensor can be connected to any of the pins on ports A, B or C. You need the following items: The sensor 3 female to female jumper wires, 10cm or more Connection Steps: Follow these steps to avoid damage to the JackBord or the sensor. The jumper wires are connected to the sensor as shown in the picture below. In our case, we have used a red jumper for the 5V power, a purple one for the output and a green one for ground. Connect yours by following these steps: Turn off the JackBord Connect a red female to jumper to the rightmost pin of the sensor, note this is with the sensor facing up as in the picture on the left. Connect a green or black jumper wire to the center ground pin. Connect a jumper for the output to the left pin. In our case we used a purple jumper. Check your sensor connections with the picture below. Here we have used a red wire for 5V, a purple one for the output and a green one for ground. Connecting the Sensor to the JackBord Now that we have the jumpers connected to the sensor we need to connect the other ends to the JackBord. These connections are listed in the table. We are going to connect the sensor to port Pin A1 on port A. We will also use port A's ground and 5V power line to keep things tidy. Follow these steps to connect the sensor to the JackBord: Turn off the JackBord Connect the green ground wire from the sensor to the ground pin on port A. Connect the red power wire from the sensor to the +5V pin on port A. Connect the purple output wire from the sensor to port pin A1 on the JackBord. Once you have made the connections check them against the pictures below and make sure they match. Using the Sensor with the JackBord Turn on the JackBord and go to the dashboard. We can use the button press and release commands, with this sensor so we can get the JackBord to take certain actions in response to the state of the sensor. When an object is detected the output will go high (3V) and once the object leaves the sensors view the output will go back to being low (0V). Example Commands: The commands below setup the sensor on port A1 so that when an object is detected the USER LED on the front of the JackBord will be turned on, this is accomplished by the bts command. The USER LED will turn off once the object leaves the field and this is because of the btr command. If needed clear any current button setup using the rstb command. btp a1 l1 1 btr a1 l1 0 Previous Next

  • Sensors - Short Range Proximity

    This sensor uses an infrared transmitter and receiver to gauge the distance between the sensor and an object near it. It has a digital and an analog output which can be used to control things in response to the presence or absence of an object. < Back Short Range Proximity This sensor uses an infrared transmitter and receiver to gauge the distance between the sensor and an object near it. It has a digital and an analog output which can be used to control things in response to the presence or absence of an object. This sensor uses an infrared transmitter and receiver to gauge the distance between the sensor and an object near it. It has a digital and an analog output which can be used to control things in response to the presence or absence of an object. Quick Commands To get the sensor working, assuming the analog pout is connected to port A a1 and the digital output is connected to a2, enter the commands below at the command prompt. gvr a1 0 100 get a2 The gvr a1 0 100 will result in the value of a1 increasing as an object moves away from the sensor. You can see this change on the LIVE page. Buttons The button press btp and button release btr commands can be used with this sensor. This example uses a button on port a pin a2 and turns the USER LED (l1) on when the sensor detects an object. Removing the object turns it off. btp a2 l1 1 btr a2 l1 0 Videos Getting Started Using the Sensor NOTES AND CAUTIONS: This sensor needs to be adjusted if you want to use the digital output It's maximum range is about 5cm Ambient lighting can affect the performance of the sensor Parts of the Sensor Power LED - Turns on when the power is applied. Detection LED - Turns on when an object is detected. Variable Resistor - Used to adjust the sensitivity of the digital output. Transmitter - The infrared transmitter. Receiver - The infrared receiver. How it Works The transmitter sends an infrared signal and the receiver receives any signal reflected by an object nearby. The closer the objects the stronger the infrared signal that's returned and the lower the output voltage on the analog output. The digital output will go high (3V) when an object is detected and the blue variable resistor sets the trigger threshold for the digital output. Input and Output Pins The sensor has two output pins described below: Connecting the Sensor to the JackBord First bolt the sensor onto port A using an M4 nut and bolt. This is because we're going to use the pins from port A to control the sensor and specifically we need the analog inputs on port A. Take a green jumper wire and connect it to the ground pin on the JackBord and take the other end and connect it to the green ground pin on the sensor. Connect a yellow jumper wire to the 3V pin on the JackBord on port A and then connect the other end to the 3V power input on the sensor. Connect a black jumper wire to the digital output of the sensor and the other end goes to port A pin a2. Connect the analog output of the sensor which is the white pin onto port pin a1 of the JackBord. When you are done it should look like the picture below: Previous Next

  • Sensors - BME280 Temperature, Relative Humidity and Pressure

    This sensor allows you to measure air temperature, relative humidity and atmospheric 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

  • 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. < 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.

  • Projects - Soccer Robot

    In this project, you will use your JackBord to play soccer! We do this by turning an ice cream container into a scoop or a foot so the JackBord can push a ball from one point to another. < Back Soccer Robot In this project, you will use your JackBord to play soccer! We do this by turning an ice cream container into a scoop or a foot so the JackBord can push a ball from one point to another. This project also includes different ways you can play and different challenges you can implement in order to make driving and scoring more difficult for your robot. One of these challenges includes programming the buttons on the DRIVE page on the dashboard, and then using these buttons to control your soccer robot. PDF INSTRUCTIONS Project Gallery

  • Smart RGB LED Random Flashing

    Smart RGB LED Random Flashing Program This program has 6 WS2812B smart LEDs connected to port A pin a1. It will cycle the LEDs through random colors. < Back Smart RGB LED Random Flashing Smart RGB LED Random Flashing Program This program has 6 WS2812B smart LEDs connected to port A pin a1. It will cycle the LEDs through random colors. Program --- Smart LED Random Flashing Program This program has 6 WS2812B smart LED's connected to port A pin a1. It will cycle the LEDs through random colors. --- prog_vars = d/led_no 0 d/red 0 d/green 0 d/blue 0 prog_vars. prog_start = print "Smart LED Program Started" -- turn all 6 leds off sled a1 6 0 /red /green /blue prog_start. prog_loop = -- Set each color to a random value rand 0 255 -> /red rand 0 255 -> /green rand 0 255 -> /blue -- Set the LEDs color -- /led_no is the LED we are setting. sled a1 6 /led_no /red /green /blue -- Inc to the next LED and then start again. any /led_no >= 6 -> /led_no 0 else inc /led_no enda. prog_loop. prog_stop = print "prog stopped" prog_stop.

  • Maths Functions Example

    This is a small program showing the various maths functions in Octagon. < Back Maths Functions Example This is a small program showing the various maths functions in Octagon. Program --- Maths Functions Program Example --- prog_vars = d/a 10 -- integer var set to 10 d/b 100 -- integer var set to 100 d/c -3.141 -- float var set to -3.141 d/result 0.0 -- float to hold total prog_vars. prog_start = print "Maths Example Program no 1" prog_start. prog_loop = -- Display system var /pi print "Pi is /pi" add /a /b /c -> /result -- Add some numbers print "adding /a /b /c = /result" -- Set new value of /c /c 1.5 -- Subtract some numbers sub /a /b /c -> /result print "subtracting /a /b /c = /result" -- Multiply some numbers mul /a /b /c -> /result print "multiplying /a /b /c = /result" -- Divide some numbers div /a /b /c -> /result print "dividing /a /b /c = /result" -- Root of pi sqrt /pi -> /result print "root of pi is /result" -- New Values /a 25|/b 50|/c 100.0 -- Average of some numbers ave /a /b /c -> /result print "ave /a /b /c = /result" -- Analyse some numbers min /a /b /c -> /result print "min of /a /b /c is /result" max /a /b /c -> /result print "max of /a /b /c is /result" -- Hash of pi hash /pi -> /result -- Get a random number between 0 and 1000 rand 0 1000 -> /result print "Random number /result" print "Done exiting now!" exitprog prog_loop. prog_stop = exitprog prog_stop.

  • RGB Light Mixer

    Light Mixer Program Uses an RGB LED on Port C and two variable resistors on pin B1 and B2. B1 controls the RED LED on C1. B2 controls the RED LED on C2. < Back RGB Light Mixer Light Mixer Program Uses an RGB LED on Port C and two variable resistors on pin B1 and B2. B1 controls the RED LED on C1. B2 controls the RED LED on C2. Program --- Light Mixer Program Uses an RGB LED on Port C and two variable resistors on pin B1 and B2. B1 controls the RED LED on C1. B2 controls the RED LED on C2. --- prog_vars = d/a 0 prog_vars. prog_start = -- Setup the RED LED control, B1 gvr b1 0 100 c1 pwm c1 50 -- Setup the GREEN LED control, B2 gvr b2 0 100 c2 pwm c2 50 prog_start. prog_loop = exitnow prog_loop. prog_stop = "Good bye" prog_stop.

  • Nested Ant Test

    This program is to test the ability of Octagon to handle nested ant commands. < 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 ---

  • Octagon Drawing Example

    This program draws various shapes on the Show page and is a good way of getting started with the drawing commands in Octagon. < Back Octagon Drawing Example This program draws various shapes on the Show page and is a good way of getting started with the drawing commands in Octagon. Program --- Octagon Drawing Program --- prog_vars = d/step 0 d/color 0 d/opacity 1.0 d/arc_angle 0 d/arc_radius 0 prog_vars. prog_start = pclear ptl f a ^ts=20^tf=verdana^ "JackBord Oactagon Drawing Program" psq t e 100 ^fc=red ^ pcr t h 50 ^fc=cyan ^ prect o j f e ^fc=yellow ^lc=yellow^lw=5^ prog_start. prog_loop = -- main program loop repeat 35 -> pal /step /step /step /step ^lc=/color ^op=/opacity ^lw=50^ mapi 0 520 0 360 /step -> /arc_angle mapi 0 520 0 100 /step -> /arc_radius parc 400 200 /arc_radius 0 /arc_angle ^lc=/color ^fc=transparent^lw=16^ inc /step 15 dec /opacity 0.05 any /opacity <= 0 -> /opacity 1.0 inc /color any /color >= 15 -> /color 1 ptl t c "step /step" repeat. exitprog prog_loop. prog_stop = print "Bye" prog_stop.

  • 404 Error Page | Jackbord

    Oops, this page isn't available. Sorry about that. It may still be a work in progress, or you may need to simply try again. Return Home

  • Projects - WiFi Signal Dial

    In this project, we are going to turn the JackBord into a dial so we can visually see the strength of the WiFi signal it is currently receiving. We will use an RC servo, which will move its arm in response to the WiFi strength. < Back WiFi Signal Dial In this project, we are going to turn the JackBord into a dial so we can visually see the strength of the WiFi signal it is currently receiving. We will use an RC servo, which will move its arm in response to the WiFi strength. First, we learn how the JackBord measures WiFi strength, and then we learn how to attach a RC servo to the JackBord. We then create our own dial and attach it to the JackBord and the RC servo. Finally, we put it all together by running a program that controls the servo’s arm based on the strength of the WiFi. PDF INSTRUCTIONS Project Gallery

  • Light Following Robot

    In this program, the JackBord robot will follow a light. This uses two LDR light sensors, each controlling the opposite motor. < Back Light Following Robot In this program, the JackBord robot will follow a light. This uses two LDR light sensors, each controlling the opposite motor. Program --- Light Following Robot Program Robot will follow a light. Uses two LDR light sensors, each controlling the opposite motor. --- prog_vars = d/count 0 prog_vars. prog_start = "Light Following Robot Program" "Setup" -- Send left light sensor reading into right motor -- on channel 160 gvr b1 -50 75 160 -- Send right light sensor reading into left motor -- on channel 170 gvr b2 -50 75 170 prog_start. prog_loop = patdog prog_loop. prog_stop = -- Stop the program. print "Prog End!" -- Clear the gvr commands boff -- Stop the motors stop prog_stop.

  • Vector Graphics Test

    < Back Vector Graphics Test Program --- Vector Graphics Test Program. --- prog_vars = d/count 0 d/xpos 0 d/ypos 0 d/text_to_show "Jack is a very good boy" prog_vars. prog_start = print "Program Start" gvr b1 0 100 pclear ptl 100 200 "Some Text 100 200 /text_to_show" ptl 0 0 "Letter Position 0 0 /text_to_show" ptl a a "Letter Position a a /text_to_show" ptl z z "ZZ Letter Position z z /text_to_show" ptl m i "Letter Position m i /text_to_show" -- Rectangle pr 80 123 100 100 ^id=r1^width=2^fill=red^color=blue^round=2^ pr 180 223 100 50 ^id=r1^width=5^fill=lime^color=brown^round=2^ -- exitnow -- Button pb j j ^name=d1 2^press=d1 1|d2 1^rel=doff^ pb o j ^name=c1 2^press=c1 1|c2 1^rel=coff^ pb l l ^name=Clear^press=pclear^ -- Circle pcr 140 300 20 ^id=c8^width=2^fill=red^color=blue^ -- Vertical Line pvl b 100 60 ^width=20^color=blue^lcap=rect^ pvl e 100 60 ^width=20^color=blue^lcap=round^ pvl i 100 60 ^width=20^color=blue^lcap=square^ -- Horizonbtal Line phl i j 60 ^width=20^color=blue^lcap=rect^ phl i k 60 ^width=20^color=blue^lcap=round^ -- Button pb j j ^name=d1 2^press=d1 1|d2 1^rel=doff^ -- ptl with Tags ptl 100 100 ^size=24^font=Arial^ "Some Text 100 100" prog_start. prog_loop = -- main program loop print "Count /count" -- Display B1 pvl j 100 /b1 ^id=b1^width=20^color=yellow^lcap=rect^ ptl j 120 ^id=tb1^ "b1 /b1" any /count < 20 -> inc /count ptl /xpos /ypos "Count /count" -- Circle pcr 140 300 /ypos ^id=c8^width=2^fill=red^color=blue^ inc /xpos 25 inc /ypos 25 enda. any /count >= 200 -> exitprog prog_loop. prog_stop = print "Bye" prog_stop.

  • Drive Motors

    MK1-DRV Motors Connecting the Drive Motors To attach the MK1-DRV Drive Motors to the JackBord, follow the PDF instructions on the right or one of our videos below. Drive Commands

  • Variables Example

    Create and use some variables in Octagon. Do some maths on some variables and display the results. The result of the program running should be: Done exiting now! Result of subtracting is : 10 100 1.50 is -91.50 Result of adding 10 100 -3.14 is 106.86 Variables Example Program no 1 < Back Variables Example Create and use some variables in Octagon. Do some maths on some variables and display the results. The result of the program running should be: Done exiting now! Result of subtracting is : 10 100 1.50 is -91.50 Result of adding 10 100 -3.14 is 106.86 Variables Example Program no 1 Program --- Variables Program Example Create and use some variables in Octagon --- prog_vars = d/a 10 -- integer var set to 10 d/b 100 -- integer var set to 100 d/c -3.141 -- float var set to -3.141 d/total 0.0 -- float to hold total d/message "" -- text var, empty prog_vars. prog_start = /total 0.0 -- reset /total to 0.0 prog_start. prog_loop = print "Variables Example Program no 1" -- Add some numbers , store result in /total add /a /b /c -> /total -- Set a message to show /message "Result of adding " -- Show the result print "/message /a /b /c is /total" -- Set new value of /c /c 1.5 -- Subtract some numbers , store result in /total sub /a /b /c -> /total -- Update the /message /message "Result of subtracting is : " -- Show the result print "/message /a /b /c is /total" print "Done exiting now!" exitprog prog_loop. prog_stop = exitprog prog_stop.

  • Plot a Tan Wave

    Plots a tan wave with the lbar command. < Back Plot a Tan Wave Plots a tan wave with the lbar command. Program --- Plot a tan wave with the plot command. --- prog_vars = d/angle 0.0 d/Xpos 0 d/raw_tan 0.0 d/tan_value 0.0 prog_vars. prog_start = pclear ptl 10 0 ^ts=24^tc=blue^ "Plot a Tan wave" prog_start. prog_loop = -- Calc tan of the abgle tan /angle -> /raw_tan -- Scale the tan wave to fit. mapf -1 1 0 50 /raw_tan -> /tan_value -- Plot the Tan wave. plot 10 50 ^t1n=TAN^xdp=100^xp=/Xpos^v1=/tan_value^ inc /angle 0.1 -- 0.1 best -- Check if we should exit. any /Xpos > 100 -> exitprog inc /Xpos prog_loop. prog_stop = print "Good bye" prog_stop.

  • RC Servo Demo

    This program steps the servos shaft from 0 to 180 degrees and back to 0 in 10deg steps. The servo is connected to port A1. Print the arm angle in the print tab. This goes with the Using RC Servos Part 2 video < Back RC Servo Demo This program steps the servos shaft from 0 to 180 degrees and back to 0 in 10deg steps. The servo is connected to port A1. Print the arm angle in the print tab. This goes with the Using RC Servos Part 2 video Program --- RC Servo Demo 1 THis program steps the servos shaft from 0 to 180 degrees and back to 0 in 10deg steps. The servo is connected to port A1. Print the arm angle in the print tab. --- prog_vars = d/count 0 d/arm_angle 0 prog_vars. prog_start = pclear svp a1 0 print "RC Servo Demo 1: Start" prog_start. prog_loop = -- main program loop -- 0 to 180 repeat 18 -> svp a1 /arm_angle "Arm Angle /arm_angle" inc /arm_angle 10 d50 repeat. -- 180 to 0 repeat 18 -> svp a1 /arm_angle "Arm Angle /arm_angle" dec /arm_angle 10 d50 repeat. -- exit the program exitprog prog_loop. prog_stop = print "Bye" svp a1 0 prog_stop.

bottom of page