12#ifndef __AVR_ATmega32U4__
13#error "This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu."
73 return USBSTA >> VBUS & 1;
79 const uint8_t sampleCount = 8;
81 for (uint8_t i = 0; i < sampleCount; i++)
83 sum += analogRead(A1);
90 const uint32_t correction = 32 * sampleCount - 1;
91 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.
static void setOutput(bool value) __attribute__((always_inline))
Sets the pin as an output.