"Stopwatcher" - Stopwatch and Lap Timer

This doesn’t really serve any purpose other than it’s a great example of how to manage multiple timers and count time with milli-second accuracy.

You could hook up some IR/laser sensors and use it to record RC car lap times and upload them to a webserver etc

Grab latest code here: https://github.com/jaminNZx/ESP-Stopwatch-Lap-Logger/releases/latest

I need to add physical pin input for a hall sensor to record lap times on what ever you like.

9 Likes

Is the coding compatible with the new Blynk IOT interface? I’m having trouble deciding which virtual pins connect with which input/output device

Yes, with little bit of modifications. Please read this :point_down:t2:

There aren’t any input/output devices used in this sketch, all of the inputs are via the Blynk app, and all of the outputs are to the Blynk app.
If you want to attach physical devices to your board, such as the IR, Laser and Hall-effect sensors mentioned, then you’d need to use physical pins for this, and add the code that monitors these pins and takes the appropriate action when the sensor the status of these pins changes.

Pete.

Hey, this is a really interesting project. I looked through the code and I found two lines, which left me baffled.

Blynk.virtualWrite(6, "add", rowIndex, String("Lap ") + rowIndex, 
 StopwatchGetFormatted(StopwatchTimeLapMilliSec, 1));
Blynk.virtualWrite(6, "pick", rowIndex);
  1. Virutal Pin 6 is a String, right?
  2. And you are basically using String concatenation?
  3. Which Widget did you “connect” with VP6?
  4. Are “add” and “pick” keywords for that widget?
  5. Is that widget usable in blynk 2.0?

Sorry for the many questions and my bad english (non native speaker).

This code relates to the Legacy Table widget.
The table widget isn’t available in Blynk IoT at the moment.

Pete.

Thank you for your fast answer!