Search Results
285 results found with an empty search
- Raspberry Shake Quake Alert
Raspberry Shake Quake Alert Program This program gets the Raspberry Pi Shakes geophone EHZ channel and d-trends it before plotting it. It also lets you set an alert threshold such that when the geophone value goes above the threshold an alert message is displayed. < Back Raspberry Shake Quake Alert Raspberry Shake Quake Alert Program This program gets the Raspberry Pi Shakes geophone EHZ channel and d-trends it before plotting it. It also lets you set an alert threshold such that when the geophone value goes above the threshold an alert message is displayed. Program --- Raspberry Shake Quake Alert Program This program gets the Raspberry Pi Shakes geophone EHZ channel and detrends it before plotting it. Set an alert threshold for the alarm to be triggered. --- prog_vars = d/count 0 d/xpos 0 -- Processed Geophone Sensor Value -- This has been detrended d/pro_EHZ 0.0 d/prev_EHZ 0.0 prog_vars. prog_start = pclear d500 -- Display the Title. ptl 100 1 ^ts=24^tc=blue^ "Raspberry Shake Alert Program" -- Add Quit Button pb 25 50 ^n=Quit^p=exitprog^ prog_start. prog_loop = -- main program loop inc /count -- Stop after 10,000 readings any /count >= 10000 -> exitprog -- Ignore the first few readings so the de-ttending can work any /count >= 3 -> -- Get a fresh set of readings from the shake -- grsk AM.R5C47 grsk AM.R7DD4 -- Wait a while for next readings -- NEED this delay. d250 -- d-trend the reading sub /rs_EHZ /prev_EHZ -> /pro_EHZ -- Invert the negative values abs /pro_EHZ -> /pro_EHZ -- Plot the pro_EHZ geophone value plot 10 150 ^id=rs^t1n=Z^t2n=E^t3n=N^xp=/xpos^v1=/pro_EHZ^ -- Display the plot value ptl 30 100 ^ts=16^ "X /xpos > EHZ /rs_EHZ pro EHZ /pro_EHZ " -- Check for a Quake any /pro_EHZ >= 500 -> -- YES we have a quake ptl 100 40 ^ts=25^tc=red^ "Tapapa Hopukina Kia mau" else -- NO no quake ptl 100 40 ^ts=25^tc=Lime^ "OK" enda. -- Next Xpos inc /xpos enda. -- Update the previous value. /prev_EHZ /rs_EHZ prog_loop. prog_stop = ptl 25 25 ^ts=75^ "Bye" prog_stop.
- Rocket Launch
This program displays some information during a rocket launch. < Back Rocket Launch This program displays some information during a rocket launch. Program --- First Octagon Progam Refer to section 5.2 of the JackBord JOurneys book no 1 while looking at this program. --- prog_vars = d/launch_rocket 0 d/air_temperature 0.0 d/rh 0 d/address "" prog_vars. prog_start = -- Setup the pgoram /launch_rocket 10 /air_temperature 28.5 /rh 80 /address "1 Olympus Mons Mars" prog_start. prog_loop = -- Display some information print "Launch in /launch_rocket secs" print "to /address" print "where the air temp is /air_temperature RH is /rh" exitprog prog_loop. prog_stop = print "Prog STOPPED!" prog_stop.
- Educators
Educators SHOP JackBords are robust and multifunctional devices that seamlessly integrates electronics, science, coding, robotics, and construction—all in one powerful tool!" Authentic learning The possibilities are in the minds and hands of users No prior knowledge is required. Students can learn at their own pace inspired by over 100 activities covering 4 Levels within 4 Foundation and 6 Application subjects. With learner and teachers guides educators can deliver curriculum and achievement standards. Ideal for primary and secondary schools, home schoolers, maker groups, holiday workshops, youth groups, JackBord will captivate curious minds for hours, opening up a world of opportunity in science, engineering, technology, robotics and more. Find out what teachers think Step-by-step guides & videos make learning & teaching a breeze! & much more! Now with a basic foundation in electronics, coding and sensors the world of STEM really opens up. We provide many more Guides, Activities and Projects for Science, Robotics Technology Engineering Arts & more! to inspire curious minds to create their own projects Sensors Progress you prior learnings in electronics and coding to discover how sensors work from our huge range, use your electronics knowledge to connect them to the JackBord, then use programming to collect the data! Test for temperature and humidity, soil moisture, light, Ph, water cleanliness, range, numerous possibilities. Programming Now move on to coding, including the concepts of data and data processing leading to practical application. We have our very own coding language called Octagon, which is great for beginners and an ideal segue into other programming languages. Electronics Start your journey by learning about electronic components, theory and application. Electronics lays the foundation for coding and robotics. Learn to design and construct electronic circuits! Table of User Guides & Activities Learning Materials Delivering curriculum and providing achievement standards couldn't be easier with easy to understand video guides and activities. Learners need no prior knowledge and can learn at their own pace Professional Development Teachers take control of own professional development in IT. Keep ahead of the students. No prior knowledge required and learn at your own pace and place with our easy to follow video guides and activities. Octagon Our own built-in programming language. Easy to learn and use and a fantastic stepping stone to more complex languages such as Python or Java Script. More advanced programmers can skip Octagon and programme JackBord using Python. It couldn't be easier! Virtual JackBord Use anywhere, anytime. Wi fi / IR enabled. Learners can carry on their projects online / at home on their own DashBoard. No need to take away the hardware JackBord Basic Keep water, soil moisture or air cleanliness monitoring projects going for months on end with our JackBord Basic. Analyse the data with Octagon Build robots, toys, games, science projects, weather stations, testing environments, greenhouses, pendulums, tools ...-you name it. Bolt on JacKano, our precision laser cut, aluminium parts which you put together using real nuts 'n bolts. The possibilities are in the hands of users. JacKano MeKits & Sensors MeKits are special collections of parts we have put together to give learners a head start with projects in Science, Horticulture, Robotics, Electronics, Construction. These will inspire them to make their own projects using an array of sensors, servos, motors and JacKano available. TOP Learn basic electronics with no prior knowledge with the amazing TOPs (Pro TOP & Basic TOP) With built in LEDs, resistors, capacitors, transistors, switches build circuits and bring electronics alive. Understanding electronics is the foundation to programming and robotics. Community Work with the local community to monitor a local stream's water quality, an area's micro climate or air quality, wi fi hot spots, or build a beach cleaning robot (picture above). The possibilities are limited only by imaginations Ideal for library after school or holiday programmes, Youth groups SHOP Agricultural & Horticultural Science Design & Visual Communication Chemistry & Biology Digital Technologies Physics, Earth & Space Science Engineering Science Construction Statistics & Mathematics Geography English (Te Reo Māori to come) Robotics
- Input/Output Commands
Command Guide < Back Input/Output Commands #off Turn All of a Port's Pins Off #off Turn all of port #’s pins off. Purpose This will turn all of the pins on the specified port off. Syntax #off Arguments # The port letter a, c, d, e Examples aoff Turn all port A pins off coff Turn all port C pin off Notes See the #on command to turn port pins on #on Turn All of a Port's Pins On #on Turn all of port #’s pins on. Purpose This will turn all of the pins on the specified port on. Syntax #on Arguments # The port letter a, c, d, e Examples aon Turn all port A pins on con Turn all port C pin on Notes See the #off command to turn port pins off. #~ Turn Pin On or Off #~ Turn pin on or off Purpose Allows you to turn a given port A, C, D, E pin on or off. Syntax # ~ state Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 state The desired state of the pin. 0=OFF 1=ON Pushers No Returns Nothing Examples a1 1 Turn port A pin 1 on a1 0 Turn port A pin 1 off Notes This can be used from the command line and in programs. Channels & Vars Updates the corresponding channel. get #~ Turns the Pin Into an Input and Gets a Reading From It get #~ Turns the pin into an input and gets a reading from it Purpose Set the pin as an input and get a fresh reading from it in real time. Syntax get #~ Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 Notes Takes a direct reading from the hardware pin. glr Get a Fresh Set of Readings and Display Them glr Get a fresh set of readings and display them Purpose This will get fresh readings from any sensors etc and display them. Syntax glr gqr Get Quick Readings in One Line Form gqr Get quick readings in one line form Purpose Gets a set of readings and puts them on one line Syntax gqr Examples > gqr < a1000a2000a3000a4000a5000 b1 000 b2 000 b3 000 b4 000 b5 000 c1 000 c2 000 c3 000 c4 000 c5 000 d1 000 d2 000 d3 000 d4 000 d5 000 e1 000e2000e3000e4000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 grd Get Raw Readings from the Channels in One Line Form grd Get raw readings from the channels in one line form Purpose Gets a fresh set of raw readings and displays them on one line Syntax grd Examples > grd < 1 0 0.00|2 0 0.00|3 0 0.00|4 0 0.00|5 0 0.00|6 0 0.00|7 0 0.00|8 0 0.00|9 0 0.00| 10 0 0.00|11 0 0.00|12 0 0.00|13 0 0.00| 14 0 0.00|15 0 0.00|16 0 0.00|17 0 0.00| 18 0 0.00|19 0 0.00|20 0 0.00|21 0 0.00| 22 0 0.00|23 0 0.00|24 0 0.00|25 0 0.00| 26 0 0.00|27 0 0.00|28 0 0.00|29 0 0.00| 30 0 0.00|31 0 0.00|32 0 0.00|33 0 0.00| 34 0 0.00|35 0 0.00|36 0 0.00|37 0 0.00| 38 0 0.00|39 0 0.00|40 0 0.00| Notes The format of the output is: |chan raw raw_float| grrd Get Real Raw Readings from the Channels in One Line Form grrd Get real raw readings from the channels in one line form Purpose Gets a fresh set of raw readings and displays them on one line Syntax grrd Examples > grrd < a10a20a30a40a50b10b20b3 0 b4 0 b5 0 c1 0 c2 0 c3 0 c4 0 c5 0 d1 0 d2 0 d3 1 d4 0 d5 0 e1 0 e2 0 e3 0 e4 0 Notes The format of the output is: pin value gt Get the Values of the Specified Port gt Get the values of the specified port. Purpose Returns a table of the current values of the port #. If the # port is left out it return the values of all ports. Syntax gt# or gt Arguments # The port letter a, b, c, d, e Examples gt a Get the port A values gt 6 Get the value of channel 6 Notes The type column shows the current type of the pin. pulse Pulse Output pulse Pulse Output Purpose Pulses the selected output on for the specified length of time Syntax pulse #~ time Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 time (milli secs) The amount of time for which the pin will remain high. Pushers No Examples pulse a1 100 Pulse a1 on for 100ms puon Set the Pin as an Input with the Pull-Up Resistor Enabled puon Set the pin as an input with the pull-up resistor enabled Purpose Makes the pin an input with an internal pull-up resistor enabled Syntax puon #~ Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 Examples puon c5 puon a4 spex Set Port Expander spex Set Port Expander Purpose This will setup the specified MCP23017 i/o expander on a virtual port with a port letter from h to l Syntax spex addr port Arguments addr The i2c address on which the expander is located port The letter of the virtual port to which the i/o expander is to be associated with: h, i, j, k or l Pushers No Examples spec 12 h Link the i/o expander on i2c address 12 to virtual port h Notes Once linked the i/o expander port pins may be used in the same manner as normal pins. ie using the #~ notation. The difference is that each i/o expander port has 8 pins instead of 5. spm Set a Pin's Mode of Operation spm Set a pins mode of operation Purpose Set the mode of operation of a pin Syntax spm #~ mode Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 mode The mode of operation for the pin Mode Description 0 Logic input no pull-up resistor 1 Logic input with pull-up resistor on 2 Logic output 3 Analog input port b only Notes spm a1 1 Set pin a1 as a logic input with a pull- up resistor spm a4 2 Set pin a4 as a logic output tg #~ Toggle the Value of the Selected Pin tg #~ Toggle the value of the selected pin Purpose Toggles the value of the selected pin. If it’s on it will go off and vice versa Syntax tg #~ Arguments # The port letter a, b, c, d ~ The port pin number 1 to 5 Pushers Yes Returns Nothing Examples tg a1 Toggle value of a1 tg d1 Toggle the value of the USER LED tg d1 -> /user_led_state
- Any and All Numbers Test
This program tests the any and all instructions with floating point and integer numbers. < Back Any and All Numbers Test This program tests the any and all instructions with floating point and integer numbers. Program --- Any and All Numbers Test Program --- prog_vars = d/pin1 0 d/pin2 1 d/float1 12.5 d/float2 3.141 d/int1 10 d/int2 0 d/pin_no 0 d/text1 "Jack" d/text2 "Jill" prog_vars. prog_start = print " -------------- " print "all statement test program" prog_start. prog_loop = -- Test 1 Should be TRUE ie /pin_no != 1 /pin1 0 /pin2 1 /pin_no 2 all /pin_no != 1 -> print "Test 1 TRUE CORRECT" else print "Test 1 FALSE WRONG" exitprog enda. -- Test 2 Should be FALSE ie /text1 not = to /text2 all /text1 = /text2 -> print "Test 2 TRUE WRONG" else print "Test 2 FALSE CORRECT" exitprog enda. -- Test 3 Should be TRUE ie /text1 is != /text2 all /text1 != /text2 -> print "Test 3 TRUE CORRECT" else print "Test 3 FALSE WRONG" exitprog enda. -- Test 4 Should be TRUE ie /text1 is "JacK" all /text1 = "Jack" -> print "Test 4 TRUE CORRECT" else print "Test 3 FALSE WRONG" exitprog enda. -- Test 5 Should be TRUE ie /float1 = 12.5 all /float1 = 12.5 -> print "Test 5 TRUE CORRECT" else print "Test 5 FALSE WRONG" exitprog enda. -- Test 6 Should be TRUE ie /float1 > /float2 all /float1 > /float2 -> print "Test 6 TRUE CORRECT" else print "Test 6 FALSE WRONG" exitprog enda. prog_loop. prog_stop = print "Bye" prog_stop.
- Age Calculator
This program takes the persons birth year and the current year and calculates their age. It then works out their age if they were born 10 years earlier. < Back Age Calculator This program takes the persons birth year and the current year and calculates their age. It then works out their age if they were born 10 years earlier. Program --- Age Calculator Program Example Uses the birth year and the current year to workout your age. Then it subtracts 10 years from their birth year. --- prog_vars = d/name "Fred" -- name text var with default value d/birth_year 1972 -- year of birth d/current_year 2020 -- the current year d/age 0 -- age in years d/message1 "If you were born 10 years earlier" prog_vars. prog_start = print " .......... " print "Age Program Begin" prog_start. prog_loop = -- Work Out their age sub /current_year /birth_year -> /age print "Hi /name you are /age years old" -- Subtract 10 years from their birth year and recalc. sub /birth_year 10 -> /birth_year print "New birth year /birth_year" -- Work Out their newage sub /current_year /birth_year -> /age -- Use /message1 to hold the message so the lines not too long. print "/message1" print "you would be /age years old" print "Done exiting now!" exitprog prog_loop. prog_stop = exitprog prog_stop.
- getline Example
This program prompts the user for their name and displays it to them. It uses the getline command to get the users input from the command line. < Back getline Example This program prompts the user for their name and displays it to them. It uses the getline command to get the users input from the command line. Program --- Name Program get the users name and display it --- prog_vars = d/name "" prog_vars. prog_start = print "Name Program" prog_start. prog_loop = print "What is your name?" getline -> /name print "Your name is: /name hello /name" exitprog prog_loop. prog_stop = print "bye /name" prog_stop.
- Turbidity Program
Measures turbidity and displays it on the USER led as colors. < Back Turbidity Program Measures turbidity and displays it on the USER led as colors. Program --- Turbidity Meter Program --- prog_vars = d/count 0 d/turbidity 0 prog_vars. prog_start = pclear print "Program Start" gvr a1 100 0 prog_start. prog_loop = mapi 0 100 1 16 /a1 -> /turbidity "a1 /a1 turbidity /turbidity" d250 l1 /turbidity prog_loop. prog_stop = print "Bye" prog_stop.
- 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. < 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
This program will display the Wifi signal strength received by the JackBord. it will do 100 runs and then stop. It uses the /s_wifisig system variable to get the Wifi signal strength. < Back Simple WiFi Signal This program will display the Wifi signal strength received by the JackBord. it will do 100 runs and then stop. It uses the /s_wifisig system variable to get the Wifi signal strength. Program --- Simple Wifi Signal Program This program will display the Wifi signal strength received by the JackBord. it will do 100 runs and then stop. It uses the /s_wifisig system variable to get the Wifi signal strength. --- prog_vars = d/run_no 0 prog_vars. prog_start = "Wifi Signal Program" prog_start. prog_loop = -- Display the Wifi Signal Strength "Run /run_no Wifi signal /s_wifisig" -- 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.
- 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. < 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.
- Junior Robot Wars Mine 3 Dec 2020
This is the mine program for the Junior Robot Wars Competition 3 Dec 2020. < Back Junior Robot Wars Mine 3 Dec 2020 This is the mine program for the Junior Robot Wars Competition 3 Dec 2020. Program --- Junior Robot Wars Mine Program 3 Dec 2020 --- prog_vars = d/hits 0 d/hit_result 0 d/health 10 d/flashes 0 d/died 0 prog_vars. prog_start = "Mine Start" coff repeat 10 -> tg c2|d100 -- Setup the bumper pins A1 & A2 btp a1 do_boom btp a2 do_boom hled prog_start. prog_loop = patdog 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 -> /hit_result -- Update the health var add /health /hit_result -> /health -- Flash for neg /hit_result ie deduct health any /hit_result < 0 -> /flashes 2 -- Count no of hits inc /hits print "T /hits TR /hit_result H /health F /flashes" show_hit_color /hit_result /flashes do_boom. show_hit_color /hit_color 0 /hit_flashes 0 = -- All c off coff -- Get abs version of color abs /hit_color -> /hit_color hled repeat /hit_flashes -> ant /hit_color -> = 1 -> sled a3 6 /hit_color 0 255 0 = 2 -> sled a3 6 /hit_color 0 255 255 = 3 -> sled a3 6 /hit_color 255 255 0 = 4 -> sled a3 6 /hit_color 255 0 255 = 5 -> sled a3 6 /hit_color 0 0 255 = 6 -> sled a3 6 /hit_color 0 255 0 -> hled ant. d500 hled repeat. show_hit_color. prog_stop = coff ant /died -> = 1 -> "Died Hits"|c1 1 = 2 -> "Died Health"|c3 1 -> c2 1 ant. rstb prog_stop.
- 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. < 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.
- 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. < 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.
- 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. < 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.
- 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. < 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.
- Smart Night Light
This uses the JackBord block 3s internal USER LEDs to create a smart night light. A button attached to pin A1 is used to set the mode of operation of the light. Mode 1 produces warmer colors because it uses more red light. Mode 2 results in more daylight color because it uses more blue and green light. < Back Smart Night Light This uses the JackBord block 3s internal USER LEDs to create a smart night light. A button attached to pin A1 is used to set the mode of operation of the light. Mode 1 produces warmer colors because it uses more red light. Mode 2 results in more daylight color because it uses more blue and green light. Program --- Smart Night Light Program This uses the JackBord block 3's internal USER LEDs to create a smart night light. A button attached to pin A1 is used to set the mode of operation of the light. --- prog_vars = d/led_no 0 d/red 0 d/green 0 d/blue 0 d/mode 1 prog_vars. prog_start = pclear print "Smart Night Light Program Started" -- turn all USER leds off loff -- Setup the button on A1 to set the mode btp a1 set_mode prog_start. prog_loop = "mode /mode" -- Determien the mode we should be in ant /mode -> = 1 -> mode1 = 2 -> mode2 -> mode1 ant. -- Set the color of the USER LEDs l1 /red /green /blue l2 /red /green /blue l3 /red /green /blue -- Wait a while dly 1000 prog_loop. set_mode = -- called by the button press. -- If we are in mode 1 goto mode 2. ant /mode -> = 1 -> /mode 2 = 2 -> /mode 1 -> /mode 1 ant. print "New Mode /mode" set_mode. mode1 = -- Use more Red colors by using more red in the light. -- and use less of the other colors. rand 100 255 -> /red rand 0 100 -> /green rand 0 100 -> /blue mode1. mode2 = -- Use more daylight colors by using more blue and green in the light. -- and use less red. rand 0 100 -> /red rand 100 255 -> /green rand 100 255 -> /blue mode2. prog_stop = print "prog stopped" prog_stop.
- PWM Commands
Command Guide < 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
- Sensors - Colour Sensor Module
The TCS34725 colour module allows the JackBord to determine the colour of a surface or object placed near the sensor. < Back Colour Sensor Module The TCS34725 colour module allows the JackBord to determine the colour of a surface or object placed near the sensor. The TCS34725 color module allows the JackBord to determine the color of a surface or object placed near the sensor. Connecting the Sensor to the JackBord The sensor uses the I2C bus on the JackBord, which is located on port D. The diagram below shows the connections between the color sensor and the JackBord. Once you have connected the sensor to the JackBord log into your dashboard and open the command line. Once there we need to type the following commands 1. To turn on the I2C System, type: i2con 2. To find the color sensor, type: f2c This will find the sensor and display a result like the one below. > f2c < Finding I2C Devices.... < TCS34725 RGB Color Sensor at address [41] < Found 1 devices If the sensor is not found check your connections. 3. To get some readings, type: gt you should see something like this: 26 CT COLOR TEMP 7749 7749.00 K 27 LIGHT LUX 845 845.00 lux 28 RED RED 797 797.00 Int 29 GREEN GREEN 1307 1307.00 Int 30 BLUE BLUE 1310 1310.00 Int 31 CLEAR CLEAR 3354 3354.00 Int 32 COLOR COLOR 3354 3354.00 Txt Note the maximum value for all of the channels is 65535. Previous Next
- 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. < 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.


