AStar32U4 library
|
#include <FastGPIO.h>
#include <Pushbutton.h>
#include <AStar32U4LCD.h>
#include <AStar32U4Buzzer.h>
#include <AStar32U4Buttons.h>
#include <AStar32U4Motors.h>
#include <avr/io.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
void | ledRed (bool on) |
Turns the red user LED (RX) on or off. More... | |
void | ledYellow (bool on) |
Turns the yellow user LED on pin 13 on or off. More... | |
void | ledGreen (bool on) |
Turns the green user LED (TX) on or off. More... | |
bool | usbPowerPresent () |
Returns true if USB power is detected. More... | |
uint16_t | readBatteryMillivoltsLV4 (uint8_t pin=A1) |
Reads the battery voltage for an A-Star 32U4 Prime LV (ac03e) and returns it in millivolts. More... | |
uint16_t | readBatteryMillivoltsLV3 (uint8_t pin=A1) |
Reads the battery voltage for an A-Star 32U4 Prime LV (ac03b) or Robot Controller LV and returns it in millivolts. More... | |
uint16_t | readBatteryMillivoltsSV (uint8_t pin=A1) |
Reads the battery voltage for an A-Star 32U4 Prime SV or Robot Controller SV and returns it in millivolts. More... | |
uint16_t | readBatteryMillivolts (uint8_t pin=A1) |
uint16_t | readBatteryMillivoltsLV (uint8_t pin=A1) |
This is the main header file for the AStar32U4 library. It includes all the other header files provided by the library.
Definition in file AStar32U4.h.
|
inline |
Turns the green user LED (TX) on or off.
on | 1 to turn on the LED, 0 to turn it off. |
The green user LED is pin PD5, which is also known as TXLED. The Arduino core code uses this LED to indicate when it receives data over USB, so it might be hard to control this LED when USB is connected.
Definition at line 47 of file AStar32U4.h.
|
inline |
Turns the red user LED (RX) on or off.
on | 1 to turn on the LED, 0 to turn it off. |
The red user LED is on pin 17, which is also known as PB0, SS, and RXLED. The Arduino core code uses this LED to indicate when it receives data over USB, so it might be hard to control this LED when USB is connected.
Definition at line 27 of file AStar32U4.h.
|
inline |
Turns the yellow user LED on pin 13 on or off.
on | 1 to turn on the LED, 0 to turn it off. |
Definition at line 35 of file AStar32U4.h.
|
inline |
Definition at line 172 of file AStar32U4.h.
|
inline |
Definition at line 180 of file AStar32U4.h.
|
inline |
Reads the battery voltage for an A-Star 32U4 Prime LV (ac03b) or Robot Controller LV and returns it in millivolts.
This function performs an analog reading and uses it to compute the voltage on the A-Star's VIN pin in millivolts. This only works if the specified pin (A1 by default) has been connected to BATLEV.
This function is only meant to be run on A-Stars with a 1/3 voltage divider:
It will give incorrect results on other versions.
pin | The pin number to read. This argument is passed on to analogRead. The default value is A1 . |
Definition at line 117 of file AStar32U4.h.
|
inline |
Reads the battery voltage for an A-Star 32U4 Prime LV (ac03e) and returns it in millivolts.
This function performs an analog reading and uses it to compute the voltage on the A-Star's VIN pin in millivolts. This only works if the specified pin (A1 by default) has been connected to BATLEV.
This function is only meant to be run on A-Stars with a 1/4 voltage divider:
It will give incorrect results on other versions.
pin | The pin number to read. This argument is passed on to analogRead. The default value is A1 . |
Definition at line 82 of file AStar32U4.h.
|
inline |
Reads the battery voltage for an A-Star 32U4 Prime SV or Robot Controller SV and returns it in millivolts.
This function performs an analog reading and uses it to compute the voltage on the A-Star 32U4 Prime SV's VIN pin in millivolts. This only works if the specified pin (A1 by default) has been connected to BATLEV.
This function is only meant to be run on A-Stars with a 1/8 voltage divider:
It will give incorrect results on other versions.
pin | The pin number to read. This argument is passed on to analogRead. The default value is A1 . |
Definition at line 152 of file AStar32U4.h.
|
inline |
Returns true if USB power is detected.
This function returns true if power is detected on the board's USB port and returns false otherwise. It uses the ATmega32U4's VBUS line, which is directly connected to the power pin of the USB connector.
Definition at line 60 of file AStar32U4.h.