[PictoBloxExtension]
Quarky Advance Line Following

Extension Description
-
Available in: Block Coding, Python Coding
-
Mode: Stage Mode, Upload Mode
-
WiFi Required: No
-
Compatible Hardware in Block Coding: Quarky
-
Compatible Hardware in Python: Quarky
-
Object Declaration in Python: linefollow = quarkyAdvanceLineFollowing();
-
Extension Catergory: Quarky
Introduction
The extension helps you to speed up your quarky in the line following using blocks and Python functions.
Read More
PictoBlox Blocks
Block Coding Examples
All articles loaded
No more articles to load
Python Functions
The function turns off all the LEDs of the Quarky.
Syntax: cleardisplay()
The function sets the threshold value of the specified IR sensor to the specified value. The value can be from 0 to 4095.
Syntax: setirthreshold(sensor = “IRL”, value = 1200)
The function stops both the motors of the Quarky robot.
Syntax: stoprobot()
The function stops the execution of the audio running on Quarky.
Syntax: stopaudio()
This function is used to analyze the image received as input from the stage, for the feature.
Syntax: analysestage()
This function is used to analyze the image received as input from the stage, for the handwritten and printed text.
Syntax: analysestage()
The function reports the last text detected from the speech.
Syntax: speechresult()
The function sets the place action angle with the specified angle. This is useful to set a custom place angle for the pick and place robot.
Syntax: setplaceangle(angle = 40)
The function is used to open a camera for video capture.
Syntax: cv2.VideoCapture(camera_id = 0)
The function performs the selected motion for the quadruped. The motion runs for the specified times and at the specified speed.
Syntax: move(motion = “forward”, time period = 1000, cycle = 1)
The function reports the state of the flame sensor connected to the selected pin. The function returns 1 when it is HIGH (or 3.3V) or 0 when it is LOW (or 0V).
Syntax: flamestatus(pin = “D3”)
The function creates a new feed with the specified name in the Adafruit IO account.
Syntax: adaio.createfeed(feed name = “feed name”)
The function makes the servo motors connected to the wheels orient inwards. This orientation is used for making the robot turn right and left efficiently.
Syntax: setinangle(Angle = 40)
The function calibrates the angles of the hip and foot servo motors and saves them in the memory of Quarky.
Syntax: sethandoffset(Left Hand Offset = 0, Right Hand Offset = 0)
The function causes the robot to move in a specified direction with a specified speed for a given amount of time before stopping automatically.
Syntax: runtimedrobot(direction = “forward”, speed = 100, time = 1000)
The function moves all the servo motors connected to the Quarky Expansion board servo ports 1 through 8.
Syntax: moveall(angle 1 = 90, angle 2 = 90, angle 3 = 90, angle 4 = 90, angle 5 = 90, angle 6 = 90, angle 7 = 90, angle 8 = 90, time = 1000)
The function is used to calculate the arcsine (inverse of the sine function) of the given value and return the arcsine in radians.
Syntax: math.asin(x)
This function sets all servo motors of a robotic arm to their default angle, referred to as the “home” position.
Syntax: roboticArm.sethome()
This function allows the robot to turn left or right to follow the next black line by setting the IR threshold and adjusting turn speed.
Syntax: turnrobotusingir(turn_direction = ‘left’, next_line = ‘next’)
This function is used to set the threshold for the confidence (accuracy) of face detection, 0 being low confidence and 1 being high confidence.
Syntax: setthreshold(threshold = 0.5)
The function changes its sprite’s costume to the next one in the costumes pane, but if the current costume is the last in the list, the block will loop to the first.
Syntax: nextcostume()
The function changes the specified sound effect by the values. The input is for selecting how much the sound will be changed. A positive number will make the sound effect have more effect, while a negative number will make it smaller.
Syntax: changesoundeffect(effect_name = “PITCH”, effect_value = 10)
The function will make an input box (with the specified text above it) show at the bottom of the screen. Users can input text into it and submit it, and the input is stored then in the Answer. The Answer automatic updates to the most recent input.
Syntax: input(question = “What is your name”)
If a sprite is currently using the pen because of the down() function, the up() function will cause the sprite to stop drawing a trail. (Otherwise, it has no effect.)
Syntax: up()
The function sets the analog state of the specified pin to the specified value between 0 to 255.
Syntax: setanalogoutput(pin)
The function sets the RGB LED matrix to the pattern specified in Pictoblox. The parameter passed is a 35 char string where each char corresponds to a color in the color palette.
Syntax: drawpattern(pattern = “aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa”)
The function returns the state of the specified IR sensor. It returns True if the current IR sensor value is greater than the threshold value, else False.
Syntax: getirstate(sensor = “IRL”)
The function initializes the following line parameters for the Quarky robot – F. T1 and T2.
Syntax: initializelinefollower(F = 35, T1 = 40, T2 = 10)
The function plays the tone on the speaker for the specified note and duration. The duration is calculated by the factor.
Syntax: playtone(note = “C4”, duration_factor = 1)
This function is used to analyze the image received as input from the current backdrop image, for the feature.
Syntax: analysebackdrop()
All articles loaded
No more articles to load
Table of Contents