Project tutorial
GLCD Dancing Man

GLCD Dancing Man © MIT

Dancing Man in 1Sheeld GLCD.

  • 758 views
  • 1 comment
  • 5 respects

Components and supplies

About this project

just a simple example to test the speed of 1sheeld's GLCD


Code

GLCD_dancing_man.inoC/C++
#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);
}

Schematics

GLCD Running Man.fzz
when you press on the button it starts dancing.
GLCD%20Running%20Man.fzz

Comments

Similar projects you might like

GLCD Cat

Project tutorial by soso artist

  • 610 views
  • 0 comments
  • 1 respect

Control your home devices using GLCD and Voice Recognition

Project in progress by Mahmoud Osman

  • 1,961 views
  • 0 comments
  • 6 respects

1Sheeld GLCD Scrolling Text

by bigboystoys13

  • 994 views
  • 0 comments
  • 9 respects

GLCD simple house

Project showcase by soso artist

  • 629 views
  • 0 comments
  • 1 respect

Bluetooth Steering wheel for a robot using 1Sheeld

Project tutorial by Kristian Blåsol

  • 2,440 views
  • 1 comment
  • 13 respects

Analog Clock using 1Sheeld Graphical LCD

Project tutorial by Ahmed El-Hinidy

  • 2,198 views
  • 0 comments
  • 7 respects
Add projectSign up / Login