12 #ifndef __AVR_ATmega32U4__
13 #error "This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu."
25 #include <Zumo32U4OLED.h>
39 FastGPIO::Pin<17>::setOutput(!on);
47 FastGPIO::Pin<13>::setOutput(on);
59 FastGPIO::Pin<IO_D5>::setOutput(!on);
72 return USBSTA >> VBUS & 1;
78 const uint8_t sampleCount = 8;
80 for (uint8_t i = 0; i < sampleCount; i++)
82 sum += analogRead(A1);
89 const uint32_t correction = 32 * sampleCount - 1;
90 return ((uint32_t)sum * 625 + correction) / (64 * sampleCount);
void ledGreen(bool on)
Turns the green user LED (TX) on or off.
void ledYellow(bool on)
Turns the yellow user LED on pin 13 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 ledRed(bool on)
Turns the red user LED (RX) on or off.