
5
4. Usage
This Grove-Encoder is very easy to use with the Encoder Lib designed by seeedstudio. Simply connect this
module to the D2 connector of Base Shield and you can start using. The following is a introduction of how
to make a Circular LED bar (the idea came from seeedstudio wish).
This Circular LED bar consists of an Encoder and a Grove-CircularLED module. Connect the two modules
to Base shield as the following picture:
In the project, the TimeOne Lib and Encoder Lib and CircularLED Library are needed. Download all the
librarys and install them to your Arduino IDE.
Restart the Arduino IDE and open the example by the
path :File->Examples->Encoder->EncodeCircuiBar.
#include <CircularLED.h>
#include <Encoder.h>
#include <TimerOne.h>
CircularLED circularLED;
unsigned int LED[24];
int index_LED;
void setup()
{
encoder.Timer_init();
}