11 #ifndef __AVR_ATmega32U4__
12 #error "This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu."
24 #include <Pololu3piPlus32U4OLED.h>
41 FastGPIO::Pin<17>::setOutput(!on);
49 FastGPIO::Pin<13>::setOutput(on);
61 FastGPIO::Pin<IO_D5>::setOutput(!on);
74 return USBSTA >> VBUS & 1;
80 const uint8_t sampleCount = 8;
82 for (uint8_t i = 0; i < sampleCount; i++)
84 sum += analogRead(A1);
91 const uint32_t correction = 64 * sampleCount - 1;
92 return ((uint32_t)sum * 1875 + correction) / (128 * sampleCount);
Top-level namespace for the Pololu3piPlus32U4 library.
void ledGreen(bool on)
Turns the green user LED (TX) on or off.
uint16_t readBatteryMillivolts()
Reads the battery voltage and returns it in millivolts.
bool usbPowerPresent()
Returns true if USB power is detected.
void ledYellow(bool on)
Turns the yellow user LED on pin 13 on or off.
void ledRed(bool on)
Turns the red user LED (RX) on or off.