12 #ifndef __AVR_ATmega32U4__ 13 #error "This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu." 67 return USBSTA >> VBUS & 1;
76 const uint8_t sampleCount = 8;
78 for (uint8_t i = 0; i < sampleCount; i++)
80 sum += analogRead(A1);
87 const uint32_t correction = 64 * sampleCount - 1;
88 return ((uint32_t)sum * 1875 + correction) / (128 * sampleCount);
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.
static void setOutput(bool value) __attribute__((always_inline))
Sets the pin as an output.
uint16_t readBatteryMillivolts()
Reads the battery voltage and returns it in millivolts.
bool usbPowerPresent()
Returns true if USB power is detected.
void ledGreen(bool on)
Turns the green user LED (TX) on or off.