Page 1
TETRIX® PRIZM® Pro Teacher Resources 79423-4...
Page 2
A downloadable PDF of the most recent version of this guide can be found at 02/25 Pitsco.com/products/tetrix-prizm-pro-controller 79423-4 This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation.
PRIZM Pro Arduino library as further updates are released. For more on the TETRIX building system: To view support videos and to download resources, visit Pitsco.com Youtube.com/TETRIXbyPitsco to learn more about the additional structural, motion, and accessory components that can be added to your collection.
Page 4
PRIZM Pro Specifications Processor ESP32-S3, Xtensa dual-core 32-bit LX7 microprocessor, 240 MHz 2 MB SRAM Flash 8 MB 2.0 Full Speed (12 Mbit/s) Wireless 2.4 GHz Wi-Fi (802.11 b/g/n), Bluetooth 5 LE DC Motor Ports (x4) 10 amp continuous, 30 amp peak per channel Encoder Ports (x4) Full quadrature type Servo Motor Ports...
Page 5
PRIZM Pro Robotics Controller Functional Overview The PRIZM Pro controller is connected to a computer using a standard USB cable connection. Power is supplied from an external TETRIX 12-Volt Rechargeable NiMH Battery Pack. The controller features support for four high-current DC motors, each motor having quadrature encoder support for implementing precise PID DC motor velocity and position control.
Page 6
DC motor speed and position control. We have Note: Encoders are included included code examples using encoders and all PRIZM Pro Arduino library functions as part of the TETRIX MAX associated with encoders. These code examples can be found in the TorqueNADO® Motors. To utilize the File >...
Page 7
PRIZM Pro Expansion Port The PRIZM Pro controller has a Grove-style input, labeled EXP, connected to the onboard I2C bus. This port can be used to connect additional TETRIX DC Motor Controllers and servo controllers in a daisy-chain arrangement. Up to four additional DC and/or servo motor controller boxes of any combination can be connected to the expansion port for added motor control channels.
Page 8
PRIZM Pro Reset Button The red Reset button is used for two purposes. When pressed, it will terminate any program code that is being executed and reset all sensor and encoder data values to their initialized states. It effectively resets the entire system just as switching power off and back on would do.
Page 9
PRIZM Pro DC Motor Ports The PRIZM Pro controller has four DC motor connection ports labeled 1-4. Each motor channel is used to control the speed and direction of DC motors via software commands defined in the PRIZM Pro Arduino Software (IDE) Library. Each motor channel can provide 10 amps of continuous DC current at 12 volts.
Page 10
TETRIX® PRIZM Pro – Arduino Library Reference Description Syntax Function Example Prizm Begin PrizmBegin(); // initialize the controller. PrizmBegin(); Initializes the PRIZM Pro controller. Must be placed at the top of the sketch Parameters: None setup() function. Prizm End PrizmEnd(); // terminate the sketch and reset When called, immediately terminates a controller.
Page 11
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Set DC Motor Speeds setMotorSpeeds(speed1, speed2, // spin motors 1-4 clockwise at 360 Uses velocity PID control to speed3, speed4); DPS. simultaneously set the constant setMotorSpeeds(360, 360, 360, 360); speeds of all motor channels with Parameters: // spin motor 1 clockwise, motor 2...
Page 12
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Set Motor Degrees setMotorDegrees(speed1, degrees1, // spin motors 1-4 at a constant speed Uses velocity and positional PID speed2, degrees2, speed3, degrees3, of 180 DPS until each motor encoder control to set the constant speeds and speed4, degrees4);...
Page 13
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Get Encoder Degrees getEncoderDegrees(encoder); // read the current degree count of Reads the encoder degree value. This encoder 1. function is similar to the encoder count Parameters: readEncoderDegrees(1); function, but instead of returning the encoder: 1,2,3,4 (unsigned integer) // read the current degree count of raw encoder count value, it returns...
Page 14
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Get Push Button Condition getButton(button); // read the condition of button A. getButton(BUTTON_A); Reads the condition of the push buttons. A returned value of “1” (true) Parameters: getButton(0); indicates a pressed condition. A Button: BUTTON_A, BUTTON_C returned value of “0”...
Page 15
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Set Positions of All Servo Motors setServoPositions(position1, // set the position of all six servo Set the position of all six servo motors position2, position3, position4, motors to 90 degrees. in a single statement.
Page 16
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Play a Musical Note setSoundNote(note, duration); // play musical note C sharp octave 6 Plays a note for from the musical scale. for 1000 milliseconds (1 second). The optional duration parameter will Parameters: setSoundNote (NOTE_CS6,...
Page 17
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Set Pixel Pattern setPixelPattern(pattern, red, green, // show the rainbow pattern setPixelPattern(PIXEL_RAINBOW); Shows a built-in LED animation across blue); the pixels. See the pixel appendix for a // show the sparkle pattern in a pale Parameters: list of effects.
Page 18
TETRIX® PRIZM Pro – Arduino Library Reference Description Function Coding Example Get the digital value from a sensor getSensorDigital(port, pin); // read the digital input data value port input pin connected to sensor port 5, data pin 2. This function returns the digital input Parameters: getSensorDigital (5, 2);...
TETRIX® PRIZM Pro – Arduino Library Reference Color Wheel: Teacher Resources...
Page 21
TETRIX® PRIZM Pro Arduino Library Functions Tip: When using these functions Quick Reference in our code, be sure to prefix each function with the PRIZM Pro Following is a reference for each function in the TETRIX PRIZM Pro Robotics object name that we choose using Controller Library for Arduino.
Page 22
TETRIX PRIZM Pro Sample Code Library Example 1: GettingStarted_Act1_Blink_RedLED /* PRIZM Pro Controller example program * Blink the PRIZM Pro Pixel 1 red at a 1 second flash rate * author PWU on 11/07/2024 #include <PRIZM_PRO.h> // include the PRIZM Pro library PRIZM prizm;...
Page 23
Example 3: GettingStarted_Act3_Move_Servo /* PRIZM Pro Controller example program * This program sets the speed of servo 1 to 25%. * Servo 1 is then rotated back and forth between 0 and 180 degree range. * author PWU on 11/07/2024 #include <PRIZM_PRO.h>...
Page 24
Example 5: GettingStarted_Act5_Intro_UltraSonic /* PRIZM Pro Controller example program * This example program will read the digital signal of the * Ultrasonic sensor attached to the digital sensor port D3. * The distance in centimeters of an object placed in front * of the sensor will be sent to the serial monitor window.
Page 25
Example 6: TaskBot_Act7_Drive_Foward /* PRIZM Pro Controller example program * This program will move a 2 wheel drive TaskBot forward for 3 seconds, stop and end * program. * author PWU 11/07/2024 #include <PRIZM_PRO.h> // include PRIZM Pro library PRIZM prizm; // instantiate a PRIZM Pro object “prizm”...
Page 26
Example 8: TaskBot_Act9_Drive_Square_1 /* PRIZM Pro Controller example program for a 2 wheel drive taskbot * This program will move the TaskBot in a square driving pattern. * author PWU 11/07/2024 #include <PRIZM_PRO.h> // include PRIZM Pro library PRIZM prizm; // instantiate a PRIZM Pro object “prizm”...
Page 27
Example 9: TaskBot_Act10_Drive_Square_2 /* PRIZM Pro Controller example program * This program will move a 2 wheel drive robot in a square driving pattern using a * forward and right turn function. * The left motor is on port 1 and the right motor is on port 2. * author PWU 11/07/2024 #include <PRIZM_PRO.h>...
Page 28
Example 10: TaskBot_Act11_Drive_To_Line /* PRIZM Pro Controller example program * This program will move a 2 wheel drive TaskBot forward on a white (reflective) * surface until it detects a black (non-reflective) * line. When the line is detected, the robot will stop. * Connect the line finder sensor to sensor port 3.
Page 29
Example 11: TaskBot_Act12_Follow_A_Line /* PRIZM Pro Controller example program * This program implements line following with a 2 wheel drive TaskBot. Using the * line finder sensor * on sensor port 3, the robot will follow the edge of a black stripe on a white * surface.
Page 30
Example 12: TaskBot_Act13_Drive_To_Wall /* PRIZM Pro Controller example program for 2 wheel drive taskbot. * This program uses the ultrasonic sensor connected to * sensor port 1 to detect an obstacle in it's driving path * within 25cm. When detected, the robot will stop and wait * for the object blocking it's path to be cleared.
Page 31
Example 13: TaskBot_Act14_Avoid_Obstacle /* PRIZM Pro Controller example program for 2 wheel drive taskbot. * Left motor is on motor port 1, right motor is on motor port 2. * This program uses the ultrasonic sensor connected to sensor port 1 to detect * objects in its driving path.
Page 32
Example 14: TaskBot_Act15_Combining_Sensors /* PRIZM Pro Controller example program for 2 wheel drive taskbot. * This program uses the Line Finder and the Ultrasonic sensor at the same time. * The robot will follow the edge of a black line (stripe) on a white surface and * scan for an object * in its path.
Need help?
Do you have a question about the TETRIX MAX and is the answer not in the manual?
Questions and answers