In this project i draw a countdown timer on 1sheeld GLCD shield ,the user of this project can Determines the duration of the timer using drawn button on the GLCD, when the timer reach 0 there will buzzer sound and vibration.

Step 1: About 1Sheeld and Arduino

Arduino is an open-source platform based on flexible, easy-to-use hardware and software. It is intended for anyone who has an idea for a project and wants to bring it to the real life. To make a project with Arduino you need to buy some accessories to connect your Arduino to the real world, these accessories are called shields. 1Sheeld is a shield that allows you to use your smartphone as an Arduino shield like GSM, WIFI, Gyroscope, etc. The main advantage of 1Sheeld is that it replaces all other shields with just your smartphone and saves you a fortune. It connects the Arduino to your smartphone using the Bluetooth and it gives you the ability to use more than shield at a time like GSM, WIFI, Accelerometer, Gyroscope etc.

1sheeld500.jpg


1Sheeld

Step 2: Adjust 1Sheeld

If you use an Arduino that works with 3.3 V like Arduino Due you must switch your 1Sheeld to operate on 3.3V since it may damage your board. If you use an Arduino that works with 5 V like Arduino Uno then switch your 1Sheeld to operate on 5V.

tutorials3v.png

Place your 1Sheeld on your Arduino board then plug the Arduino to your laptop or PC.

tutorials_1e9b25c2-1d63-4e9f-8c8c-a4e1bb05429d.png

If you use an Arduino Mega then connect your 1Sheeld to the Mega as shown in the image:

tutorials_4f05e06b-4248-41b5-a8f6-d8d549702ada.png


Step 3: Download the 1Sheeld application

For Android smartphones, download the application from here.

For iOS, smartphones download the application from here.

Step 4: Download 1Sheeld library to your computer

Download the library from here.

Then, after you successfully downloaded the library, add the library .ZIP file to your Arduino program.

liberey.png

Step 5: Write your code inside Arduino sketch

/*

This project uses a GLCD shiled of the one shiled to creat a count down counter using a smartphone and arduino with 1sheeld.
*/

#define CUSTOM_SETTINGS
#define INCLUDE_GLCD_SHIELD
#define INCLUDE_BUZZER_SHIELD 
#define INCLUDE_VIBRATION_SHIELD

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


/* GLCD Setup */

GLCDRectangle border1(0,0,255,127);
GLCDRectangle border2(2,2,251,123);

/* The  Buttons.*/
GLCDButton  startButton(37,87,97,122,"Start");
GLCDButton  hm(77,4,94,21,"+")  ;
GLCDButton  hl(77,66,94,83,"-") ;
GLCDButton  mm(119,4,136,21,"+");
GLCDButton  ml(119,66,136,83,"-");
GLCDButton  sm(162,4,179,21,"+");
GLCDButton  sl(162,66,179,83,"-");
/*Text boxs */
GLCDTextBox hourTextbox(75,30,"0");
GLCDTextBox minutesTextbox(120,30,"0");
GLCDTextBox secondsTextbox(165,30,"0");

int hours=0,minutes=0,second=0;
int hour_counter,minutes_counter,second_counter;
bool countDownState=false;

void setup() {

/* Start communication with 1Sheeld. */
  OneSheeld.begin();
/* Clear the GLCD. */
  GLCD.clear();
  
/* Draw all shaps. */
  GLCD.draw(border1);
  GLCD.draw(border2);
  GLCD.draw(startButton);
  GLCD.draw(hm);
  GLCD.draw(hl);
  GLCD.draw(mm);
  GLCD.draw(ml);
  GLCD.draw(sm);
  GLCD.draw(sl);
  GLCD.draw(hourTextbox);
  GLCD.draw(minutesTextbox);
  GLCD.draw(secondsTextbox);

/* Change the styles of the buttons to 3D. */
  startButton.setStyle(STYLE_3D);
  hm.setStyle(STYLE_3D);
  hl.setStyle(STYLE_3D);
  mm.setStyle(STYLE_3D);
  ml.setStyle(STYLE_3D);
  sm.setStyle(STYLE_3D);
  sl.setStyle(STYLE_3D);
  
/* Set the button dimensions. */
startButton.setDimensions(64,30);
hm.setDimensions(32,17);
hl.setDimensions(32,17);
mm.setDimensions(32,17);
ml.setDimensions(32,17);
sm.setDimensions(32,17);
sl.setDimensions(32,17);

/* set the size of the numbers*/
 hourTextbox.setSize(MEDIUM);
 minutesTextbox.setSize(MEDIUM);
 secondsTextbox.setSize(MEDIUM);
 
/* Set the button handlers. */
 
  
}

void setButtonTasks()
{
  hm.setOnChange(&hmtask);
  hl.setOnChange(&hltask);
  mm.setOnChange(&mmtask);
  ml.setOnChange(&mltask);
  sm.setOnChange(&smtask);
  sl.setOnChange(&sltask);
  startButton.setOnChange(&startButtontask);
  
}

/*Increase the hourse */
void hmtask(bool state)
{
  if...
Read more »