Search Results
285 results found with an empty search
- Sync Command Test
< Back Sync Command Test This is a program to test the new sync command. Program --- Sync Command Test Program This is a program to test the new sync command. --- prog_vars = d/var1 1 d/var2 2 d/volts 0 d/volt2 0 d/speed 0 d/light 0 d/run_no 0 d/turn_servo 0 d/sine 0.0 prog_vars. prog_start = print "Sync Test Prog" -- Sync var 2 to var 1's value. sync /var1 /var2 -- get port B1 gvr b1 -50 180 -- Setup a Sync Daisy Chain -- Sync b1 to /volts var sync b1 /volts -- get port B2 . Steering gvr b2 -100 100 sync b2 /light sync b2 153 free.5 mapi -100 100 0 180 /light -> /turn_servo sync turn_servo c1 free.1 -- Motor speed control sync /volts 150 sync 150 /speed svp c1 /speed sync b1 c1 sync /speed 150 free.5 pwm d1 50 sync b1 d1 pwm a1 50 sync /light a1 pwm a2 50 sync /light a2 sync /light d1 free.5 pwm a3 50 sync /b1 a3 pwm a4 50 sync /b1 a4 src free.1 svp c1 50 "******* RUN PROG **********" prog_start. prog_loop = -- Update var 1 /var1 /run_no sin /run_no -> /sine mapf -1 1 0 100 /sine -> /sine -- "var1 /var1 syncs to var2 /var2" -- "b1 /b1 volts /volts 150 /150" -- "light /light turn /turn_servo" tbar * /sine 50 10 "s /sine" -- svp c1 /speed -- poowm d1 /speed inc /run_no any /run_no > 1000 -> exitprog prog_loop. prog_stop = print "bye" prog_stop.
- WiFi Signal Strength using ant
< Back WiFi Signal Strength using ant This program uses the /wifisig system variable to display how good the Wifi signal the JackBord has is. It uses the ant statement to determine which message to display based upon the strength of the Wifi signal. Program --- Wifi Signal Strength Program using ant. This uses the /wifisig system variable and the ant command to check the wifi strength, and then tell you about it. NOTE: Each time the /wifisig system variable is used it updates the wifi signal reading, so they will vary. --- prog_vars = d/wifi_state "" d/wifi_sig 0 d/runs_to_do 0 d/runs_done 0 d/current_wifi 0 prog_vars. prog_start = print "Wifi Signal Strength Program" /runs_to_do 10 prog_start. prog_loop = -- Reset the wifi state var and get the wifi -- signal level from the /wifisig sys var. /wifi_state "XXX" -- Get the wifi signal strength here once as it can -- change on subsequent calls to the /wifisig sys var. /current_wifi /wifisig ant /current_wifi -> <= -85 -> /wifi_state "Not Good" <= -80 -> /wifi_state "TOO LOW!" <= -70 -> /wifi_state "LOW" <= -60 -> /wifi_state "WORSE" <= -50 -> /wifi_state "BETTER" <= -40 -> /wifi_state "GOOD" <= -30 -> /wifi_state "V GOOD" -> /wifi_state "NO Signal" ant. print "Wifi /wifi_state /current_wifi" any /runs_done = /runs_to_do -> exitprog inc /runs_done d1 0 prog_loop. prog_stop = print "Good bye" prog_stop.
- Twinkle Star
< Back Twinkle Star Make the USER LED twinkle like a star. This program uses the rand command to generate a random color which is then used to set the color of the USER LED on the front of the JackBord. Program --- Twinkle Star Program Make the USER LED twinkle like a star. --- prog_vars = d/color 0 prog_vars. prog_start = print "Twinkle Star Program." prog_start. prog_loop = -- Get a new random color rand 0 15 -> /color -- Set USER LED to the color l1 /color prog_loop. prog_stop = print "Exit Twinkle" prog_stop.
- Button Press Command Task Call Test
< Back Button Press Command Task Call Test Button Press Command Task Call Program --- Button Press Command Task Call Test Program 18 Sep 2020 --- prog_vars = d/count 0 d/total_presses 0 d/cat 0 d/dog 0 prog_vars. prog_start = print "prog started" /d1 0 rdbg 7 bdbg 5 pticks 1 chup 50 -- Set Port A1 as an input with a pullup btp a1 left_side btp a2 right_side prog_start. prog_loop = patdog inc /count patcat get a1 bms 50 prog_loop. left_side = inc /total_presses "Left /total_presses" tg c1 test_cat left_side. right_side = inc /total_presses "right /total_presses" tg c2 test_dog right_side. test_cat = inc /count inc /cat "CAT count /count cat /cat" test_cat. test_dog = dec /count inc /dog "DOG count /count dog /dog" test_dog. prog_stop = print "prog stopped" prog_stop.
- Simple Gauge Program
< Back Simple Gauge Program This program uses a gauge to display the value of a voltage being applied to pin A1. We scale the input voltage to be between 0 and 100. Connect the TOP so that POT1 is across 3V and ground and the center pin goes to pin A1 on the JackBord. Turning the pot will change the gauge reading. Program --- Simple Gauge Program This program uses a gauge to display the value of a voltage being applied to pin A1. --- prog_vars = d/count 0 prog_vars. prog_start = pclear print "Program Start" -- show the title ptl 10 10 ^ts=26^ "Simple Gauge Program" -- Add a quit button pb 500 10 ^n=Quit^p=exitprog^ -- Setup port pin A1 to be an anaog input and scale between 0 to 100. gvr a1 0 100 prog_start. prog_loop = -- main program loop -- show the gauge pg 50 100 /a1 ^min=0^max=100^n=Value^ inc /count prog_loop. prog_stop = print "Bye" ptl 350 50 ^ts=34^ "Bye" prog_stop.
- Advanced Mine
< Back Advanced Mine This program assumes that the mines trigger switches are on pins A2 & A3. When one of the switches is triggered we will either add or remove health from the robot. The RGB LEDs are connected to Port C: RED C1 GREEN C2 BLUE C3 The color values for the /color variable are: The port C values say which port C pin will be on for a given color. Color no 0 off 1 Red. C1 2 Green C2 3 Blue C3 4 Cyan C2 C3 5 Purple. C1 C3 6 Yellow C1 C2 Program --- Advanced Mine Program --- prog_vars = d/triggers 0 d/health 10 d/trig_result 0 d/flashes 0 d/start_time 0 d/run_time 0 prog_vars. prog_start = "Mine Start" /start_time /uptime -- Setup the trigger for pin A2 & A3 btp a2 do_boom btp a3 do_boom prog_start. prog_loop = -- Calc run time sub /uptime /start_time -> /run_time -- Check if we are dead >>>>>>>>>>> any /health <= 0 -> -- Dead "XXXXXX WE DIED XXXXX" repeat 10 -> tg c1|d50 exitprog enda. -- Exit any /triggers > 10 -> exitprog any /run_time >= 60 -> "Time up"|exitprog prog_loop. do_boom = --- The mine is triggered work out the health or damage. --- /flashes 0 -- Get a new random number between -6 and 6. rand -6 6 -> /trig_result -- Update the health var add /health /trig_result -> /health -- Check for negative health, if so flash 4 times. any /trig_result < 0 -> /flashes 4 inc /triggers print "Trig /triggers TR /trig_result Health /health flash /flashes" set_color /health /flashes do_boom. set_color /color 0 /led_flash 0 = --- Colors 0 off 1 Red 2 Green 3 Blue 4 Cyan c2 c3 on 5 Magenta c1 c3 6 . Yellow c1 c2 --- -- All c off coff -- Get abs version of color abs /color -> /color repeat /led_flash -> -- Set the color on Port C ant /color -> = 1 -> c1 1 = 2 -> c2 1 = 3 -> c3 1 = 4 -> c3 1|c4 1 = 5 -> c1 1|c3 1 = 6 -> c1 1|c2 1 -> c1 1|c2 1 ant. d250 -- any /led_flash > 2 -> d250 -- any /led_flash < 2 -> d1000 coff repeat. set_color. prog_stop = print "Bye" -- clear the buttons rstb prog_stop.
- Basic Forms
< Back Basic Forms Displays some form prompts that update as you enter new values. Program --- Form Program --- prog_vars = d/count 0 d/xpos 0 d/ypos 0 d/text_to_show "Jack is a very good boy" d/name "jack" d/height 1.84 d/age 0 prog_vars. prog_start = pclear ptl 100 1 ^ts=24^ "Program Start" etl h d ^pmt=Edit text^w=20^max=20^c=lime^var=name^ "Name /name" etl h f ^pmt=age^w=20^max=20^c=lime^var=age^ "/age" etl h h ^pmt=Height^w=20^max=20^c=lime^var=height^ "/height" etl h j ^pmt=Speed^max=20^var=150^ "/150" ptl h p ^id=h1^ts=16^ "Name: /name Age /age height: /height" pb 10 100 ^n=update^p=update_values^ pb 10 150 ^n=Quit^p=exitprog^ prog_start. prog_loop = -- main program loop ptl h p ^id=h1^ts=16^ "Name: /name Age /age height: /height" prog_loop. update_values = ptl h p ^id=h1^ts=16^ "Name: /name Age /age height: /height" update_values. prog_stop = print "Bye" pclear ptl m h ^ts=40^tc=red^ "Bye" prog_stop.
- Sensors - MQ4 Methane Gas
< Back MQ4 Methane Gas The MQ4 module allows the JackBord to detect methane gas at concentrations from 300 ppm to 10,000 ppm. The reading output from the sensor is an analog voltage from 0.1V to 4.5V. There is a digital output as well, pin DO, which is normally high and goes low when gas is detected. The MQ4 module allows the JackBord to detect methane gas at concentrations from 300 ppm to 10,000 ppm. The reading output from the sensor is an analog voltage from 0.1V to 4.5V. There is a digital output as well, pin DO, which is normally high and goes low when gas is detected. Quick Commands To setup the sensor and get some raw readings from it run the command below: (this assumes the sensor is on port A1) gvr a1 0 100 This gets the voltage reading from the sensor and scales it between 0 and 100, with 100 being the maximum gas reading. Some Useful Resources Understanding a Gas Sensor MQ4 Sensor Datasheet mq4_sensor .pdf Download PDF • 161KB NOTES AND CAUTIONS The sensor gets hot during use so make sure it has plenty of air flow Do not get the sensor wet The sensor is powered from 5V The JackBord is NOT waterproof, so don't allow it to become wet The sensor needs some time to warm up, the manual states about 24hours but you can start using it after about 10 minutes. Parts of the Sensor Power LED - Turns on when the power is applied. Trigger LED - Turns on when gas is detected. The selection threshold is set via the variable resistor. Variable Resistor - Used to adjust the sensitivity of the digital output. Gas Sensor - This is the sensor that detects the gas. How it Works The sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2) sensitive layer, measuring electrode and heater are fixed into a crust made by plastic and stainless steel net. An internal heater provides the heat required for the sensor to work. The sensor module has two outputs: DO which is a digital logic output and AO which is the analog output. Input and Output Pins The pins of the sensor are listed below: Connecting the Sensor to the JackBord 1. Bolt the sensor to the side of the JackBord on Port A as shown below 2. Connect the 5V power, ground, and analogue jumpers to Port A as shown below in the diagram Connections to the JackBord. The white jumper goes from the sensor's analogue output into the JackBord's port A1 pin. Using the Sensor Once the sensor is connected to the JackBord, we can get the readings from it by using port pin a1 as an analogue input. To set a1 as an analogue input type this command at the command prompt: gvr a1 1 100 This command takes the analogue output from the sensor and scales it between 0 and 100. Previous Next
- Smart LED Random Flashing
< Back Smart LED Random Flashing Smart 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.
- Combining any and all Statements Together Example
< Back Combining any and all Statements Together Example In this example program we combine any and all statements to make more complex decisions possible in Octagon. Program --- Combining any and all statements example program --- prog_vars = d/pin1 0 d/pin2 1 d/pin_no 0 prog_vars. prog_start = print " -------------- " print "any and all combination example program" prog_start. prog_loop = -- Test 1 Should be FALSE ie /pin_no < 1 /pin1 0 /pin2 1 /pin_no 0 all /pin_no >= 1 /pin_no <= 5 any /pin1 = 0 /pin2 = 1 -> print "Test 1 TRUE WRONG" else print "Test 1 FALSE CORRECT" exitprog enda. -- Test 2 Should be FALSE ie /pin_no > 5 /pin1 0 /pin2 1 /pin_no 10 all /pin_no >= 1 /pin_no <= 5 any /pin1 = 0 /pin2 = 1 -> print "Test 2 TRUE WRONG" else print "Test 2 FALSE CORRECT" exitprog enda. -- Test 3 Should be FALSE ie all anys are false /pin1 1 /pin2 0 /pin_no 3 all /pin_no >= 1 /pin_no <= 5 any /pin1 = 0 /pin2 = 1 -> print "Test 3 TRUE WRONG" else print "Test 3 FALSE CORRECT" exitprog enda. -- Test 4 Should be TRUE ie all is ok and 1 any is true /pin1 0 /pin2 0 /pin_no 3 all /pin_no >= 1 /pin_no <= 5 any /pin1 = 0 /pin2 = 1 -> print "Test 4 TRUE CORRECT" else print "Test 3 FALSE WRONG" exitprog enda. -- Test 5 Should be TRUE ie all is ok and 1 any is true /pin1 1 /pin2 1 /pin_no 3 all /pin_no >= 1 /pin_no <= 5 any /pin1 = 0 /pin2 = 1 -> print "Test 5 TRUE CORRECT" else print "Test 5 FALSE WRONG" exitprog enda. prog_loop. prog_stop = print "Bye" prog_stop.
- Colour Plot
< Back Colour Plot This program uses a variable resistor on Port pin A1 to control the color of the USER LEDs and plot the values as well. Program --- Color Plot Program Uses a variable resistor on Port pin A1 to control the color of the USER LEDs and plot the values as well. --- prog_vars = d/color 0 d/xpos = 0 prog_vars. prog_start = pclear ptl 50 10 ^ts=24^ "Color Program Start" -- Setup the analog input gvr a1 200 500 pb 50 50 ^n=Quit^p=exitprog^ prog_start. prog_loop = -- main program loop print "Xpos /xpos" inc /xpos 2 any /xpos >= 600 -> pclear|/xpos 0 -- Plot the Point pp /xpos /a3 ^lw=2^fc=/color ^lw= /color ^ -- Set the User led colors mapi 200 500 0 15 /a3 -> /color l1 /color l2 /color l3 /color prog_loop. prog_stop = ptl 200 200 ^tc=red^ts=24^ "Bye" prog_stop.
- Flash USER LED l1 with Random Colours
< Back Flash USER LED l1 with Random Colours This program flashes the USER LED l1, the one on the front of the JackBord. It will cycle USER LED 1 through the colors 0 to 15. Program --- Flash USER LED l1 with colors --- prog_vars = d/count 0 d/color 0 prog_vars. prog_start = pclear print "Program Start" prog_start. prog_loop = -- main program loop print "Count /count" inc /count any /count >= 100 -> exitprog inc /color any /color > 15 -> /color 0 /l1 /color prog_loop. prog_stop = print "Bye" prog_stop.
- Robot Arm
< Back Robot Arm An example of a robot arm. Program --- Robot Arm Program --- prog_vars = d/count 0 d/color 0 d/ledno 1 prog_vars. prog_start = print "Program Start" sledn 7 -- Setup arm buttons btp u1 svp a1 0 btp u2 svp a1 50 btp u3 svp a2 0 btp u4 svp a2 80 d/posa1 0 d/posa2 0 repeat 12 -> svp a1 /posa1 svp a2 /posa2 d250 inc /posa1 5 inc /posa2 5 "pos /posa1" repeat. repeat 12 -> svp a1 /posa1 svp a2 /posa2 d250 dec /posa1 5 dec /posa2 5 repeat. prog_start. prog_loop = sled /ledno /color inc /ledno inc /color any /ledno >= 7 -> /ledno 1 any /color >= 15 -> /color 0 prog_loop. prog_stop = print "Bye" prog_stop.
- WiFi Signal Strength using any Statements
< Back WiFi Signal Strength using any Statements This program uses the /wifisig system variable to display how good the Wifi signal the JackBord has is. It uses the any statement to determine which message to display based upon the strength of the Wifi signal. Program --- Wifi Signal Strength Program using any This uses the /wifisig system variable and a set of any commands to check the wifi strength, and tell you about it. NOTE: Each time the /wifisig system variable is used it updates the wifi signal reading, so they will vary. --- prog_vars = d/wifi_state "" d/wifi_sig 0 d/runs_to_do 0 d/runs_done 0 d/current_wifi 0 prog_vars. prog_start = print "Wifi Signal Strength Program" /runs_to_do 50 prog_start. prog_loop = -- Reset the wifi state var and get the wifi -- signal level from the /wifisig sys var. /wifi_state "XXX" -- Get the wifi signal strength here once as it can -- change on subsequent calls to the /wifisig sys var. /current_wifi /wifisig any /current_wifi <= -30 -> /wifi_state "V GOOD" any /current_wifi <= -40 -> /wifi_state "GOOD" any /current_wifi <= -50 -> /wifi_state "BETTER" any /current_wifi <= -60 -> /wifi_state "WORSE" any /current_wifi <= -70 -> /wifi_state "LOW" any /current_wifi <= -80 -> /wifi_state "TOO LOW!" print "Wifi /wifi_state /current_wifi" any /runs_done = /runs_to_do -> exitprog inc /runs_done prog_loop. prog_stop = print "Good bye" prog_stop.
- Simple WiFi Signal Version 2
< Back Simple WiFi Signal Version 2 This is a slightly more advanced version of the Simple Wifi Signal Program, that displays a comment next to the Wifi signal reading. The comments are based upon this table: Strength Meaning -30 Amazing -67 Very Good -70 OK -80 Not Good -90 Unusable It gets the Wifi signal strength from the /s_wifisig system variable and uses the ant statement to apply the correct comment based on the signal. Program --- Simple Wifi Signal Program Version 2 This is a slightly more advanced version of the Simple Wifi Signal Program, that displays a comment next to the Wifi signal reading. --- prog_vars = d/run_no 0 d/signal 0 prog_vars. prog_start = "Wifi Signal Program" prog_start. prog_loop = -- Display the Wifi Signal Strength -- "Run /run_no Wifi signal /s_wifisig" /signal /wifisig ant /signal -> <= -90 -> "Run /run_no /signal Unusable" <= -80 -> "Run /run_no /signal NOT Good" <= -70 -> "Run /run_no /signal OK" <= -67 -> "Run /run_no /signal Very good" <= -30 -> "Run /run_no /signal Amazing" -> "NO Signal" ant. -- Exit after 100 runs inc /run_no any /run_no >= 100 -> "Run /run_no Time to Exit" exitprog enda. prog_loop. prog_stop = print "Prog STOPPED!" prog_stop.
- Plot a Cos Wave
< Back Plot a Cos Wave This program uses the plot command to graph a cos wave. Program --- Plot a cos wave with the plot command. --- prog_vars = d/run_no 0 d/angle 0.0 d/Xpos 0 d/raw_cos 0.0 d/cos_value 0.0 prog_vars. prog_start = pclear ptl 10 0 ^ts=24^tc=blue^ "Plot a Cos wave" prog_start. prog_loop = -- Calc cost of the abgle cos /angle -> /raw_cos -- Scale the Cos wave to fit. mapf -1 1 0 50 /raw_cos -> /cos_value -- Plot the Cos wave. plot 10 50 ^t1n=COS^xdp=100^xp=/Xpos^v1=/cos_value^ inc /angle 0.1 -- 0.1 best inc /Xpos -- Check if we should exit. any /run_no > 100 -> exitprog inc /run_no prog_loop. prog_stop = print "Good bye" prog_stop.
- Plot a Voltage Program
< Back Plot a Voltage Program This program uses a graph plot to display the value of a voltage being applied to pin A1. We scale the input voltage to be between 0 and 100. Program --- Simple Plot Program This program uses a graph plot to display the value of a voltage being applied to pin A1. We scale the input voltage to be between 0 and 100. --- prog_vars = d/Xpos 0 prog_vars. prog_start = pclear print "Program Start" -- show the title ptl 10 10 ^ts=26^ "Simple Plot Program" -- Add a quit button pb 500 10 ^n=Quit^p=exitprog^ -- Setup port pin A1 to be an anaog input and scale between 0 to 100. gvr a1 0 100 prog_start. prog_loop = -- main program loop -- Plot the current value plot 0 50 ^id=V1^n=Voltage^xn=Time^t1n=Volts^xp=/Xpos^v1=/a1^ inc /Xpos d250 prog_loop. prog_stop = ptl 350 0 ^ts=34^ "Bye" prog_stop.
- Repeat Command Test
< Back Repeat Command Test This test program use repeat in all of the various manners it can be used in. Program --- Repeat Command Test Program --- prog_vars = d/count 1 d/rand_no 0 d/servo_pos 0 d/do_reps 0 prog_vars. prog_start = print "Repeat Test Program" pticks 5 /count 0 /rand_no 0 prog_start. prog_loop = print "Main Loop /count" inc /count -- flash user led 10 times with 50ms delay. repeat 10 -> pulse d1 50 -- Print rand no -100 to 100 rand -100 100 -> /rand_no|print "RND1 /rand_no" -- Display 5 random numbers between 1 - 100 repeat 5 -> rand 1 100 -> /rand_no|print "RND2 /rand_no" repeat 5 rand 1 100 -> /rand_no print "RND3 /rand_no" repeat. -- Exit the repeat if we get a rand no > 25 repeat 5 rand 1 100 -> /rand_no print "RND4 /rand_no" any /rand_no > 25 -> print "Exit rep"|skipout repeat. -- Flash some lights repeat 10 -> tg a1|tg a5|tg d1 -- Step a servo through 180 deg use 18 reps div 180 10 -> /do_reps repeat /do_reps -> print "Servo pos /servo_pos" -- Set the servo position. svp a1 /servo_pos -- Leave the repeat early. any /servo_pos >= 9 -> skipout -- Inc the /servo_pos by 10 inc /servo_pos 10 repeat. -- exit after 15 runs. any /count >= 15 -> print "Qu /count"|exitprog prog_loop. prog_stop = print "Prog STOPPED!" prog_stop.
- Sheep Dog Program
< Back Sheep Dog Program This program works out how many sheep dogs are required to look after a given number of black and white sheep. Program --- Sheep Dog Program --- prog_vars = d/white_sheep 0 d/black_sheep 0 d/total_sheep 0 d/runs_to_do 10 d/runs_done 1 d/colors[] "" prog_vars. prog_start = print "Sheep Program." print "No of runs to do /runs_to_do" -- Setup the colors /colors[1] "Black" /colors[2] "White" prog_start. prog_loop = -- Get more sheep, and see what color they are. get_sheep -> /qty_of_sheep /color "/runs_done > New Sheep qty /qty_of_sheep color /colors[/color]" -- Check the type of sheep, update respective count any /color = 1 -> -- update black sheep add /black_sheep /qty_of_sheep -> /black_sheep else -- update white sheep add /white_sheep /qty_of_sheep -> /white_sheep enda. -- Update the total no of sheep add /white_sheep /black_sheep -> /total_sheep -- Check how many sheep dogs we need for the sheep check_dogs /total_sheep -> /dogs_needed -- Check if its time to exit yet any /runs_done >= /runs_to_do -> exitprog enda. -- Next run inc /runs_done prog_loop. get_sheep -> /qty_of_sheep 0 /color 1 = --- Returns a random quantity of sheep, of a random color. --- rand 0 100 -> /qty_of_sheep -- Get the color of this batch of sheep. -- 1 = black 2 = white rand 1 2 -> /color get_sheep. check_dogs /no_of_sheep 0 -> /dogs_needed 0 = --- Calc the number of sheep dogs we need to manage this many sheep. Return the no of dogs we need. --- mul 0.1 /no_of_sheep -> /dogs_needed check_dogs. prog_stop = -- display the final results print "We need /dogs_needed dogs to manage them" print "Total sheep /total_sheep" print "Black /black_sheep White /white_sheep" print "Exit Prog" prog_stop.
- Octagon Drawing Example
< 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.

