Shop OBEX P1 Docs P2 Docs Learn Events
CNT adding up to trouble - Page 2 — Parallax Forums

CNT adding up to trouble

2»

Comments

  • ErlendErlend Posts: 612
    edited 2015-04-29 23:44
    JonnyMac wrote: »
    Bear in mind that with this style
    IF (CNT - iServoPulsStart) > 0
    


    is only good for delays less that 2^31 ticks (about 26ish seconds); if you need longer periods, my little time object will make things easy. I'm now using it for everything as it hides the ugly math! :)
    Yes I realise that - the forum helped me discover that effect in an other thread http://forums.parallax.com/showthread.php/159912-Trouble-with-multiple-cog-methods-reading-same-variables?
    In that instance the timing was 15 - 40 sec, so once in a while crossed the magic 26 sec border.
    In this instance it is only 20mS so I am safe.
    Your time() methods have found their way into my library, and they are certainly going to come handy, thanks.

    Erlend
Sign In or Register to comment.