The failing is not with your code. The failing is with the MPU6050_6Axis_MotionApps20.h library. It erroneously has code in the header rather than in a separate CPP file.
You have done everything right. The author of that library could do well in taking a leaf out of your book.
To get it working you will have to move the code out of the header file into the ....
This looks like a rounding problem. If the number you want to print lies
within the open interval (9.95, 10), the condition value < 10 is true,
as the number is strictly less than 10. Obviously, value != 10 is also
true. Yet, lcd.print(x, 1) will round the number to the closest
multiple of 0.1, which in this case is 10.
I see no better solution than ...
I would suggest a bit field for storing the days of the week when the
alarm is supposed to fire:
bit 0: fire on Sundays
bit 1: fire on Mondays
This numbering is meant to match the one of DateTime::dayOfTheWeek().
Pack this, together with the hour and minute of the alarm, in a struct
(or a class if you prefer). Maybe add a boolean to tell whether the
You can do this easily by using Arduino built-in PWM function and using delay function. But remember that using delay in your code will block your code so if your program just want to sit and wait for 3 seconds at some speed then delay is ok for you else you need to implement Millis function.
first you need to define different speeds as per your requirement ...
That would work. Though I feel like your solution isn't easily readable by humans, and also not easily readable by machines.
Removing the |s, making the data a fixed length, and putting each alarm on separate line, would help with both. You'd get something like
ON MTWTFSS 14:00
OFF MT T S 10:00
Because the data-string is of a fixed length, you know where ...