New answers tagged

1

There are quite a few Arduino libraries called “SimpleTimer”. According to arduinolibraries.info, the one you get through the library manager is Alexander Kiryanenko's SimpleTimer. The one described in Arduino Playground is Marcello Romani's version. You should try the examples that come with the specific library you install.


0

Even though you are not running an actual (complex) Operating System, you should adhere to common practices. For an Arduino, you should, in many cases, avoid directly controlling the hardware so as to be compatible with as many existing libraries for your particular Arduino platform as possible. Setting the timer directly (if you are using an official ...


1

CS12 has a value of 2 since it represents bit 2 of the TCCR1B register. (1 << CS12) takes the value 1 (0b00000001) and shifts it left 2 times to get (0b00000100). The order of operations dictates that things in () happen first, so this is done before the "|=" is evaluated. (1 << CS10) takes the value 1 (0b00000001) and shifts it left 0 times ...


1

I tried to understand your program and found quite a few issues, which I am listing below. This is more a general review than a specific answer. I hope it nevertheless helps you fix the code. The major issue is the logic of loop() being quite convoluted and hard to follow. My guess is that the issue you face is a direct consequence of this single problem. I ...


0

Change io 13 to (suggestion) 10 and attach led + 1k resister to io 10. 13 seems to be in use. Also No line end in Serial.


2

In your code you are using the measurement_finished variable as a flag, that a new measurement was finished inside the ISRs, so that it can be handled inside the loop() function. This is very useful. As I understood, an open circuit means, that no measurement can happen, since no pulses are created. So you need to check, how much time passed since the last ...


Top 50 recent answers are included