[PictoBloxExtension]
Quarky Ultimate Robots
Extension Description
Controls the various configurations of the Quarky robots.
-
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: Not Applicable
-
Extension Catergory: Quarky
Introduction
Python Functions
The function executes the oscillator according to stored parameters for the servo motor and the current time.
Syntax: executeoscillator()
The function reports the analog reading of the Gas sensor connected to the selected pin. The value will vary between 0 to 4095.
Syntax: gassensorvalue(pin = “A1”)
The function creates a Python object for the Thingspeak library.
Syntax: thingspeak()
The function takes the desired angle values and sets the pick and place arm to those angles.
Syntax: setarmangle(angle = 90)
This function moves the end-effector to the specified position of the chosen axis while keeping the other two axes in their current positions.
Syntax: roboticArm.gotoinoneaxis(POSITION = 150, AXIS = “x”, TIME = 1000)
PID control of line follower is a method consisting of proportional, integral, and derivative functions to improve the robot’s movement.
Syntax: setPIDconstantparameter(kp = 0.8, ki = 0.01, kd = 0.2)
This function returns the y position of the face detected. You can specify the face for which the value is needed. The position is mapped with the stage coordinates.
Syntax: y(face = 1)
The block points its sprite towards the mouse-pointer. This changes the sprite’s direction and rotates the sprite.
Syntax: pointto()
This function resets all 7 graphic effects.
Syntax: cleareffects()
The function sets the timer’s value back to 0.
Syntax: resettimer()
The function executes the oscillator according to stored parameters for the servo motor and the current angle specified in the block.
Syntax: executesscillatorat(angle = 90)
The function sets the threshold for the gas sensor. Threshold helps users decide whether the sensor is active or not. If the sensor value is greater than the threshold value, the sensor is active, or else it is inactive.
Syntax: setgasthreshold(threshold_value = 1500)
The function connects the PictoBlox to the ThinkSpeak Channel with the specified write and the read API keys. Without this function, other functionality does not work related to ThinkSpeak.
Syntax: ts.connecttothingspeak(channel_ID = 1234567, read_API = “readAPI”, write_API = “writeAPI”)
The block sets the oscillator parameters for the selected servo motor.
Syntax: setoscillationparameters(servo name = “RHip”, amplitude = 30, offset = 90, time period = 1000, phase difference = 0)
This function moves the servo motors of a pick and place robot to the angle specified by the user, allowing the robot to pick up an object.
Syntax: pick()
This function moves a robotic arm’s end-effector along a given axis by a specified amount over a given time. All other axes will remain constant.
Syntax: roboticArm.movebyinoneaxis(DISTANCE = 10, AXIS = “x”, TIME = 1000)
This function is used for set the Base Speed, Min Speed and Max Speed of motors for line following and turn.
Syntax: setPIDspeedparameter(base = 40, min = 0, max = 80)
This function returns the width of the face detected. You can specify the face for which the value is needed. The position is mapped with the stage coordinates.
Syntax: width(face = 1)
The function moves its sprite costume center’s X position by the specified amount.
Syntax: changex(delta_x = 10)
If the sprite is hidden, it will show the sprite. If the sprite is already showing, nothing will change.
Syntax: show()
The function reports the number of days (and fractions of a day) since 00:00:00 1 January 2000 (UTC).
Syntax: dayssince2000()
The function set the specified steering orientation to the specific servo motor angle. Orientations – Straight, Left and Right.
Syntax: setsteeringangle(orientation = “S”)
The function connects the soil moisture sensor to the specified pin. Once initialized, other moisture sensor-related functions can be used.
Syntax: setmoisturepin(pin = “A1”)
The function resets the oscillator parameter for all the servo motors.
Syntax: resetoscillationparameters()
This function moves the servo motors of a pick and place robot to the angle specified by the user, allowing the robot to place down an object.
Syntax: place()
This function takes in a servo type, an angle, and a time value as inputs and sets the servo to the given angle in the specified amount of time.
Syntax: roboticArm.setservoangleto(SERVO = “link1”, ANGLE = 90, TIME = 1000)
This function starts line following with the PID algorithm, stopping at a checkpoint based on the IR threshold; set PID speed, constants, and adjust parameters for best performance.
Syntax: dolinefollowingwithPID(next_checkpoint = 1)
This function returns the height of the face detected. You can specify the face for which the value is needed. The position is mapped with the stage coordinates.
Syntax: height(face = 1)
The function changes the selected sprite’s X position to a specified value.
Syntax: setx(x = -240)
All articles loaded
No more articles to load
Table of Contents