Pololu3piPlus32U4 library
Classes | Enumerations | Functions | Variables
Pololu3piPlus32U4 Namespace Reference

Top-level namespace for the Pololu3piPlus32U4 library. More...

Classes

class  BumpSensors
 Gets readings from the two bump sensors on the front of the 3pi+ 32U4. More...
 
class  ButtonA
 Interfaces with button A on the 3pi+ 32U4. More...
 
class  ButtonB
 Interfaces with button B on the 3pi+ 32U4. More...
 
class  ButtonC
 Interfaces with button C on the 3pi+ 32U4. More...
 
class  Buzzer
 Plays beeps and music on the buzzer on the 3pi+ 32U4. More...
 
class  Encoders
 Reads counts from the encoders on the 3pi+ 32U4. More...
 
class  IMU
 Interfaces with the inertial sensors on the 3pi+ 32U4. More...
 
class  LCD
 Writes data to the LCD on the 3pi+ 32U4. More...
 
class  LineSensors
 Gets readings from the five reflectance sensors on the bottom of the 3pi+ 32U4. More...
 
class  Motors
 Controls motor speed and direction on the 3pi+ 32U4. More...
 
class  OLEDCore
 Low-level functions for writing data to the SH1106 OLED on the Pololu 3pi+ 32U4 OLED robot. More...
 
class  OLED
 Makes it easy to show text and graphics on the SH1106 OLED of the Pololu 3pi+ 32U4 OLED robot. More...
 

Enumerations

enum  BumpSide { BumpLeft = 0 , BumpRight = 1 }
 Bump sensor sides. More...
 
enum class  IMUType : uint8_t { Unknown , LSM6DS33_LIS3MDL }
 The type of the inertial sensors. More...
 
enum class  LineSensorsReadMode : uint8_t { Off , On , Manual }
 Emitter behavior when taking readings. More...
 

Functions

void ledRed (bool on)
 Turns the red user LED (RX) on or off. More...
 
void ledYellow (bool on)
 Turns the yellow user LED on pin 13 on or off. More...
 
void ledGreen (bool on)
 Turns the green user LED (TX) on or off. More...
 
bool usbPowerPresent ()
 Returns true if USB power is detected. More...
 
uint16_t readBatteryMillivolts ()
 Reads the battery voltage and returns it in millivolts. More...
 
 ISR (PCINT0_vect)
 
static void rightISR ()
 

Variables

static volatile bool lastLeftA
 
static volatile bool lastLeftB
 
static volatile bool lastRightA
 
static volatile bool lastRightB
 
static volatile bool errorLeft
 
static volatile bool errorRight
 
static volatile uint16_t countLeft
 
static volatile uint16_t countRight
 

Detailed Description

Top-level namespace for the Pololu3piPlus32U4 library.

Enumeration Type Documentation

◆ BumpSide

Bump sensor sides.

Enumerator
BumpLeft 

Left bump sensor.

BumpRight 

Right bump sensor.

Definition at line 13 of file Pololu3piPlus32U4BumpSensors.h.

◆ IMUType

enum Pololu3piPlus32U4::IMUType : uint8_t
strong

The type of the inertial sensors.

Enumerator
Unknown 

Unknown or unrecognized.

LSM6DS33_LIS3MDL 

LSM6DS33 gyro + accelerometer, LIS3MDL magnetometer.

Definition at line 43 of file Pololu3piPlus32U4IMU_declaration.h.

◆ LineSensorsReadMode

Emitter behavior when taking readings.

Enumerator
Off 

Each reading is made without turning on the infrared (IR) emitters. The reading represents ambient light levels near the sensor.

On 

Each reading is made with the emitters on. The reading is a measure of reflectance.

Manual 

Calling read() with this mode prevents it from automatically controlling the emitters: they are left in their existing states, which allows manual control of the emitters for testing and advanced use. Calibrating and obtaining calibrated readings are not supported with this mode.

Definition at line 14 of file Pololu3piPlus32U4LineSensors.h.

Function Documentation

◆ ledGreen()

void Pololu3piPlus32U4::ledGreen ( bool  on)
inline

Turns the green user LED (TX) on or off.

Parameters
onA value of 1 turns on the LED; 0 turns it off.

The green user LED is pin PD5, which is also known as TXLED. The Arduino core code uses this LED to indicate when it receives data over USB, so it might be hard to control this LED when USB is connected.

Definition at line 59 of file Pololu3piPlus32U4.h.

◆ ledRed()

void Pololu3piPlus32U4::ledRed ( bool  on)
inline

Turns the red user LED (RX) on or off.

Parameters
onA value of 1 turns on the LED; 0 turns it off.

The red user LED is on pin 17, which is also known as PB0, SS, and RXLED. The Arduino core code uses this LED to indicate when it receives data over USB, so it might be hard to control this LED when USB is connected.

Definition at line 39 of file Pololu3piPlus32U4.h.

◆ ledYellow()

void Pololu3piPlus32U4::ledYellow ( bool  on)
inline

Turns the yellow user LED on pin 13 on or off.

Parameters
onA value of 1 turns on the LED; 0 turns it off.

Definition at line 47 of file Pololu3piPlus32U4.h.

◆ readBatteryMillivolts()

uint16_t Pololu3piPlus32U4::readBatteryMillivolts ( )
inline

Reads the battery voltage and returns it in millivolts.

Definition at line 78 of file Pololu3piPlus32U4.h.

◆ usbPowerPresent()

bool Pololu3piPlus32U4::usbPowerPresent ( )
inline

Returns true if USB power is detected.

This function returns true if power is detected on the board's USB port and returns false otherwise. It uses the ATmega32U4's VBUS line, which is directly connected to the power pin of the USB connector.

See also
A method for detecting whether the board's virtual COM port is open: http://arduino.cc/en/Serial/IfSerial

Definition at line 72 of file Pololu3piPlus32U4.h.