Hace bastante tiempo que ando pensando en hacer un cronometro con arduino ya que es parte de un proyecto un poco mas grande, un lap timer, como este http://ucexperiment.wordpress.com/2012/02/18/arduino-ir-lap-timer/ Lo he hecho con :

  • Arduino Mega ( no tengo otra :P )
  • LCD 8x2
  • Un potenciometro para regular la luz del LCD
  • Unos cuantos cables de prototipado
  • Protoboard

Aqui va la foto del montaje :

 

 Y aqui el codigo :

#include 
LiquidCrystal lcd(22, 24, 26, 9, 10,11, 12);
void setup() {
  Serial.begin(9600);
  lcd.begin(8,2);
  lcd.clear();
  lcd.setCursor(0,1);
  lcd.print("00:00:00");
}
unsigned long segundos_totales = 0;
unsigned long minutos = 0;
String segundos_str = "";
String minutos_str = "";
void loop() {
  segundos_totales = millis()/1000;
  String sDbg = String(millis());
  lcd.home();
  lcd.print(sDbg);
  lcd.setCursor(6,1);
  lcd.print(sDbg.substring(sDbg.length()-3,sDbg.length()-1));
  minutos = segundos_totales / 60;
  segundos_str = String(segundos_totales - (minutos * 60) );
  lcd.setCursor(3,1);
  if (segundos_str.length()==1){ lcd.print("0"); }
  lcd.print(segundos_str);
  minutos = segundos_totales / 60;
  minutos_str = String(minutos);
  lcd.setCursor(1,1);
  if (minutos_str.length()>1){lcd.setCursor(0,1);}
  lcd.print(minutos_str);
}

Espero ir evolucionando el proyecto e ir comentando los avances por aquí.

Caregorias

wilson (not verified) Fri, 09/27/2019 - 17:14

Muy interesante su proyecto, gracias por el aporte. Quizá tiene el plano electrónico del cronómetro?. Gracias

Add new comment

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
CAPTCHA
1 + 17 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.