AStar32U4 library
Functions
AStar32U4.h File Reference
#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 readBatteryMillivoltsLV (uint8_t pin=A1)
 Reads the battery voltage for an A-Star 32U4 Prime 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 and returns it in millivolts. More...
 
uint16_t readBatteryMillivolts (uint8_t pin=A1)
 

Detailed Description

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.

Function Documentation

void ledGreen ( bool  on)
inline

Turns the green user LED (TX) on or off.

Parameters
on1 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.

void ledRed ( bool  on)
inline

Turns the red user LED (RX) on or off.

Parameters
on1 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.

void ledYellow ( bool  on)
inline

Turns the yellow user LED on pin 13 on or off.

Parameters
on1 to turn on the LED, 0 to turn it off.

Definition at line 35 of file AStar32U4.h.

uint16_t readBatteryMillivolts ( uint8_t  pin = A1)
inline
Deprecated:
This function is deprecated and is only here for backwards compatibility. We recommend using readBatteryMillivoltsLV() instead.

Definition at line 129 of file AStar32U4.h.

uint16_t readBatteryMillivoltsLV ( uint8_t  pin = A1)
inline

Reads the battery voltage for an A-Star 32U4 Prime LV and returns it in millivolts.

This function performs an analog reading and uses it to compute the voltage on the A-Star 32U4 Prime LV'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 the A-Star 32U4 Prime LV (the blue board) and will give incorrect results on other versions.

Parameters
pinThe pin number to read. This argument is passed on to analogRead. The default value is A1.
See also
readBatteryMillivoltsSV()

Definition at line 79 of file AStar32U4.h.

uint16_t readBatteryMillivoltsSV ( uint8_t  pin = A1)
inline

Reads the battery voltage for an A-Star 32U4 Prime 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 the A-Star 32U4 Prime SV (the green board) and will give incorrect results on other versions.

Parameters
pinThe pin number to read. This argument is passed on to analogRead. The default value is A1.
See also
readBatteryMillivoltsLV()

Definition at line 110 of file AStar32U4.h.

bool usbPowerPresent ( )
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.

See also
A method for detecting whether the board's virtual COM port is open: http://arduino.cc/en/Serial/IfSerial

Definition at line 60 of file AStar32U4.h.