Hello
Below is my projectile speed measuring device code. I am having just one final proble,. How do I make the results of my elapsed time serial print display on my LCD screen?
#include <LiquidCrystal.h>;
unsigned long startTime;
unsigned long stopTime;
unsigned long elaspedTime;
unsigned long Time;
boolean started = false;
boolean stopped = false;
int startPin = 1;
int stopPin = 2;
const int numRows = 2;
const int numCols = 16;
LiquidCrystal lcd(11, NULL, 12, 7, 8, 9, 10);
;
void setup()
{
pinMode(stopPin, INPUT);
pinMode(startPin, INPUT);
digitalRead;
Serial.begin(9600);
}
void loop()
{
if(digitalRead(startPin) == HIGH) // The sensor has been activated
{
started = true; // If this is ture start the timer
startTime = micros(); // States when the senor has been crossed
}
if(digitalRead(stopPin) == HIGH) // The sensor has been activated
{
stopped = true; // If this is ture start the timer
stopTime = micros(); // States when the senor has been crossed
}
if(started && stopped)
{
elaspedTime = stopTime - startTime; // How long did that take?
Serial.print("elaspedTime , in microseconds: ");
Serial.println(elaspedTime );
started = false; // Reset so the senors can be tripped again
stopped = false;
}
Serial.print("elaspedTime , in seconds: ");
lcd.print("elaspedTime , in seconds: ");
}