soso artist
Published © MIT

GLCD Cat

Drawing and animating cat on glcd

AdvancedFull instructions provided1,406
GLCD Cat

Things used in this project

Story

Read more

Schematics

GLCD CAT.fzz

Here is nothing more than connecting 1sheeld and arduino.

Code

GLCD_cat.ino

C/C++
/*

GLCD Shield Example

This example shows an application on 1Sheeld's GLCD shield.

By using this example, you can draw a simple sketch on your
smartphone's screen that consists of a house, sun, boy, girl,
clouds and birds using the GLCD shapes.

OPTIONAL:
To reduce the library compiled size and limit its memory usage, you
can specify which shields you want to include in your sketch by
defining CUSTOM_SETTINGS and the shields respective INCLUDE_ define. 

*/

#define CUSTOM_SETTINGS
#define INCLUDE_GLCD_SHIELD
#define INCLUDE_TEXT_TO_SPEECH_SHIELD


/* Include 1Sheeld library. */
#include <OneSheeld.h>

GLCDLine mustacheL1(124,85,49,75);
GLCDLine mustacheL2(124,85,49,95);
GLCDLine mustacheL3(124,85,49,115);
GLCDLine mustacheR1(124,85,199,75);
GLCDLine mustacheR2(124,85,199,95);
GLCDLine mustacheR3(124,85,199,115);

GLCDEllipse mouth1(124,105,10,5);
  
void setup()
{
  /* Start communication. */
  OneSheeld.begin();

  /* Clear the GLCD. */
  GLCD.clear();
  
  drawCat();
}

void loop() {
  mouth1.setRadius(10,5);
  //OneSheeld.delay(100);
  mouth1.setRadius(10,1);
  //OneSheeld.delay(100);
  TextToSpeech.say("now");
}

void drawCat()
{
  /* Cat Elements. */
  GLCDEllipse face(124,80,50,40);
  
  GLCDEllipse eyeL(104,60,10,10);
  GLCDEllipse eyeR(144,60,10,10);
  GLCDEllipse eyeletL(104,60,4,4);
  GLCDEllipse eyeletR(144,60,4,4);
  
  GLCDLine earL1(120,40,90,10);
  GLCDLine earL2(80,60,90,10);
  GLCDLine earL3(110,40,95,20);
  GLCDLine earL4(90,50,95,20);

  GLCDLine earR1(128,40,158,10);
  GLCDLine earR2(168,60,158,10);
  GLCDLine earR3(138,40,153,20);
  GLCDLine earR4(158,50,153,20);
  
  // 124,85  119,75  129,75
  GLCDLine nose1(124,85,119,75);
  GLCDLine nose2(119,75,129,75);
  GLCDLine nose3(129,75,124,85);
  
  /*GLCDLine mustacheL1(124,85,49,75);
  GLCDLine mustacheL2(124,85,49,95);
  GLCDLine mustacheL3(124,85,49,115);
  GLCDLine mustacheR1(124,85,199,75);
  GLCDLine mustacheR2(124,85,199,95);
  GLCDLine mustacheR3(124,85,199,115);*/
  
  /*GLCDLine mouth1(134,105,114,105);
  GLCDEllipse mouth2(124,105,10,5);*/
  
  /* Drawing. */
  GLCD.draw(face);
  
  GLCD.draw(eyeL);
  GLCD.draw(eyeR);
  GLCD.draw(eyeletL);
  GLCD.draw(eyeletR);
  
  GLCD.draw(earL1);
  GLCD.draw(earR1);
  GLCD.draw(earL2);
  GLCD.draw(earR2);
  GLCD.draw(earL3);
  GLCD.draw(earR3);
  GLCD.draw(earL4);
  GLCD.draw(earR4);
  
  GLCD.draw(nose1);
  GLCD.draw(nose2);
  GLCD.draw(nose3);
  
  GLCD.draw(mustacheL1);
  GLCD.draw(mustacheL2);
  GLCD.draw(mustacheL3);
  GLCD.draw(mustacheR1);
  GLCD.draw(mustacheR2);
  GLCD.draw(mustacheR3);
  
  GLCD.draw(mouth1);
  
  /* Filling */
  eyeletL.setFill(true);
  eyeletR.setFill(true);
}

Credits

soso artist

soso artist

3 projects • 1 follower

Comments