Project tutorial
GLCD Cat

GLCD Cat © MIT

Drawing and animating cat on glcd

  • 718 views
  • 0 comments
  • 1 respect

Components and supplies

About this project

I'm trying 1Sheeld GLCD and TextToSpeech features.

Code

GLCD_cat.inoC/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);
}

Schematics

GLCD CAT.fzz
Here is nothing more than connecting 1sheeld and arduino.
GLCD%20CAT.fzz

Comments

Similar projects you might like

GLCD Dancing Man

Project tutorial by soso artist

  • 900 views
  • 1 comment
  • 5 respects

Control your home devices using GLCD and Voice Recognition

Project in progress by Mahmoud Osman

  • 2,127 views
  • 0 comments
  • 6 respects

GLCD simple house

Project showcase by soso artist

  • 727 views
  • 0 comments
  • 1 respect

1Sheeld GLCD Scrolling Text

by bigboystoys13

  • 1,152 views
  • 0 comments
  • 9 respects

Analog Clock using 1Sheeld Graphical LCD

Project tutorial by Ahmed El-Hinidy

  • 2,709 views
  • 0 comments
  • 7 respects

Countdown timer using GLCD shield

Project tutorial by Ahmed Elsagaan

  • 854 views
  • 0 comments
  • 3 respects
Add projectSign up / Login