These are chat archives for esp8266/Arduino

8th
Aug 2017
g
@anecdata
Aug 08 2017 00:13
@nmenoni You could use Ticker https://github.com/esp8266/Arduino/tree/master/libraries/Ticker to set up an interrupt. Then your timing won't be dependent on variations in your code execution.
bobcroft
@bobcroft
Aug 08 2017 06:59
@nmenoni Using a delay is possibly the worst way to implement periodic data sending or taking sensor readings because it blocks other code whilst the delay code is running. As mentioned you could use ticker alternatively Google 'Non blocking delays on Arduino' There are some examples and explanations of the process. you can use the millis() function for example or a Real Time Clock (RTC) to send data at specific times.
nmenoni
@nmenoni
Aug 08 2017 15:48
Ok! I will investigate these methods. Thanks!
mega-hz
@mega-hz
Aug 08 2017 16:10
isnT it possible to make a new delay-command in the arduino-ide?
wich replaces the standart delay with a delay using millis?
Michael Miller
@Makuna
Aug 08 2017 16:36
BUT, the issue is to allow other things to continue to work while you wait. See ticker above, I also created an Arduino one some time ago (before esp8266) Github/Makuna/Task to wrap up the concept.
While using Delay() is a nice teaching concept, it is a poor design to use for anything other than examples.