just a simple example to test the speed of 1sheeld's GLCD
#define CUSTOM_SETTINGS
#define INCLUDE_GLCD_SHIELD
/* Include 1Sheeld library. */
#include <OneSheeld.h>
GLCDEllipse head(36,64,25,25);
GLCDLine body(61,64,165,64);
GLCDLine armL(85,64,170,30);
GLCDLine armR(85,64,170,94);
GLCDLine legL(165,64,250,50);
GLCDLine legR(165,64,240,74);
GLCDLine mouth(45,54,45,74);
GLCDEllipse eyeL(30,74,5,5);
GLCDEllipse eyeR(30,54,5,5);
const byte danceButton = 7;
void setup()
{
/* Start communication. */
OneSheeld.begin();
/* Clear the GLCD. */
GLCD.clear();
drawMan();
}
void loop() {
if(digitalRead(danceButton)){
legL.setCoordinates(165,64,250,30);
legR.setCoordinates(165,64,240,94);
armL.setCoordinates(85,64,170,30);
armR.setCoordinates(85,64,170,94);
legL.setCoordinates(165,64,250,69);
legR.setCoordinates(165,64,240,60);
legL.setCoordinates(165,64,250,94);
legR.setCoordinates(165,64,240,30);
armL.setCoordinates(85,64,150,30);
armR.setCoordinates(85,64,150,94);
legL.setCoordinates(165,64,250,60);
legR.setCoordinates(165,64,240,69);
}else{
legL.setCoordinates(165,64,250,30);
legR.setCoordinates(165,64,250,94);
armL.setCoordinates(85,64,170,30);
armR.setCoordinates(85,64,170,94);
}
}
void drawMan()
{
GLCD.draw(head);
GLCD.draw(eyeL);
//eyeL.setFill(true);
GLCD.draw(eyeR);
//eyeR.setFill(true);
GLCD.draw(mouth);
GLCD.draw(body);
GLCD.draw(armL);
GLCD.draw(armR);
GLCD.draw(legL);
GLCD.draw(legR);
}
Comments