12 #ifndef __AVR_ATmega32U4__ 13 #error "This library only supports the ATmega32U4. Try selecting A-Star 32U4 in the Boards menu." 68 return USBSTA >> VBUS & 1;
77 const uint8_t sampleCount = 8;
79 for (uint8_t i = 0; i < sampleCount; i++)
81 sum += analogRead(A1);
88 const uint32_t correction = 64 * sampleCount - 1;
89 return ((uint32_t)sum * 1875 + correction) / (128 * sampleCount);
static void setOutput(bool value) __attribute__((always_inline))
Sets the pin as an output.
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.
void ledRed(bool on)
Turns the red user LED (RX) on or off.
void ledYellow(bool on)
Turns the yellow user LED on pin 13 on or off.
bool usbPowerPresent()
Returns true if USB power is detected.