TINKER PiEDESIGN IN INDIA

Getting started with TinkerPie Bricks: plug-and-play sensors for the TinkerPie board

TinkerPie Bricks are small boards that plug into the TinkerPie V1 with one cable. Smart Bricks add ports, line sensors, distance, servos, displays and a camera. Kit Bricks hold the 37 modules of the popular 37-in-1 sensor kits, so every module works without loose jumper wires.

1. Install the libraries

  1. Install the Arduino IDE and the esp32 boards package (Boards Manager, version 3.0.7 or newer).
  2. Download the TinkerPie library and the TinkerPieBricks library. In the Arduino IDE: Sketch → Include Library → Add .ZIP Library, once for each.
  3. Also install Adafruit NeoPixel, SparkFun BMI270 Arduino Library and VL53L1X (Pololu) from the Library Manager.
  4. Board: ESP32S3 Dev Module, USB CDC On Boot: Enabled, Flash Size: 16MB, Partition Scheme: 16M Flash (3MB APP/9.9MB FATFS), PSRAM: OPI PSRAM.

2. Connect

3. Addresses

Every brick has an address. Two bricks of the same type need different addresses: bridge ADDR +1, +2 or +4 on the back of the second brick and pass the new address to begin().

BrickClass and address
IO-4 Smart Bricktpb::IO4 0x30-0x33
Line Follower 5tpb::Line5 0x34-0x35
Ultrasonic Bricktpb::Ultrasonic 0x36-0x37
5V Sensor Bricktpb::Sensor5V 0x38-0x39
Display + Keys Bricktpb::Keys 0x3A, OLED 0x3C
Servo-16 Bricktpb::Servo16 0x40-0x47
I2C Mux 8tpb::Mux8 0x70-0x77
AI Camera Moduletpb::AICamera on the AI / CAMERA port
Kit Bricks: KIT SENSORtpb::KitSensor 0x08-0x0F (first 0x08), socket S + -
Kit Bricks: KIT DRIVEtpb::KitDrive 0x10-0x13 (first 0x10), socket S + -
Kit Bricks: KIT ANALOGtpb::KitAnalog 0x14-0x17 (first 0x14), socket AO G + DO
Kit Bricks: KIT DUALtpb::KitDual 0x18-0x1B (first 0x18), socket G + S L
Kit Bricks: KIT LEDtpb::KitLed 0x1C-0x1F (first 0x1C), socket R G B - (RGB) or - R G (two-colour)
Kit Bricks: KIT JOYSTICKtpb::KitJoystick 0x2C-0x2D (first 0x2C), socket G + X Y SW
Kit Bricks: KIT ENCODERtpb::KitEncoder 0x2E-0x2F (first 0x2E), socket CLK DT SW + G

4. First sketch: find your bricks

#include <TinkerPie.h>
#include <TinkerPieBricks.h>

void setup() {
  Serial.begin(115200);
  tinkerpie::begin();   // also starts the SENSOR ports (I2C)
}

void loop() {
  tpb::scan();          // lists every brick with its address and name
  delay(3000);
}

Open the Serial Monitor at 115200 baud: every brick on the bus is listed with its name.

5. Pick a brick

Every brick page has the wiring, a quick-start sketch and a project:

Bricks are programmed in Arduino C++. The block and JavaScript programs in TinkerPie Studio use the board’s own sensors and the 47 accessories on the pins.