Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 32 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,64 @@ test 1410

Written by Loovee, distributed under LGPL, for more information, please visit http://www.seeedstudio.com

This library is written for manage Xadow, include :
This library is written to manage Xadow. It includes functions to:

* user led
* charge state read
* battery voltage read
* sleep mode operation
* control the LEDs
* read the charge state
* read the battery voltage
* put the xadow to sleep

Also see the examples directory for:

* reading the barometer
* vibrating the vibrator
* reading the accelerometer
* reading and setting the real-time-clock

FUNCTION
-------------------------------------------------------------------------------------------------------------------
you can use the folowing function, it's useful in some way.
It contains the following functions:

### Initialization
void init();

### Get Voltage of battery
### Get the voltage of the battery
float getBatVol();

### Get Charge State
### Get the charge state
unsigned char getChrgState();

it'll return the folowing value:
getChrgState() will return one of the following values:

#define NOCHARGE 0
#define CHARGING 1
#define CHARGDONE 2

### User Led
there'are two user led that you can use, a green one and a read one.
### User LED
there'are two user LEDs that you can use, a green one and a red one.

void greenLed(unsigned char state); // green Led drive
void redLed(unsigned char state); // red led drive
void greenLed(unsigned char state); // green LED drive
void redLed(unsigned char state); // red LED drive

about the input value, you can use:
To control the LED state, you use:

#define LEDON 1 // led on
#define LEDOFF 2 // led off
#define LEDCHG 3 // change led state
#define LEDON 1 // turn the LED on
#define LEDOFF 2 // turn the LED off
#define LEDCHG 3 // toggle the LED state

### Power Manage
of curse, sometimes you want your xadow goto sleep to save some power, then you can use this function:
### Power Management
Sometimes you may want to put your xadow to sleep to save power. Use:

void pwrDown(unsigned long tSleep); // power down, tSleep ms
void pwrDown(unsigned long tSleep); // power down, tSleep milliSeconds to sleep for

it'll let your xadow goto sleep for sSleep ms, then it'll wake, you shourld use the folowing function to awake it:
It will put your xadow to sleep for sSleep ms, then it will wake. You should use the following function to wake it up:

void wakeUp(); // wake up


APPLICATION
-------------------------------------------------------------------------------------------------------------------
there'are some application here, for more applicaton you can refer to examples
See the examples sub-directory which has complete and extended example code. The following is the basic examples of using the library:

### POWER DOWN MODE

Expand All @@ -80,7 +87,7 @@ there'are some application here, for more applicaton you can refer to examples
Xadow.pwrDown(1000); // sleep for 1000ms
Xadow.wakeUp(); // wake up
cout << "wake up" << endl;
delay(500); // delay 500 ms
delay(500); // delay 500ms
}


Expand Down Expand Up @@ -121,7 +128,7 @@ there'are some application here, for more applicaton you can refer to examples

void loop()
{
Xadow.greenLed(LEDON); // green led on
Xadow.greenLed(LEDON); // green led on
Xadow.redLed(LEDOFF); // red led off
delay(200);
Xadow.redLed(LEDON); // red led on
Expand All @@ -133,4 +140,4 @@ there'are some application here, for more applicaton you can refer to examples
OTHERS
--------------------------------------------------------------------

anymore problem, please send me a email: luweicong@seeedstudio.com
If you have any problems, please send me an email: luweicong@seeedstudio.com