Exemple #1
0
 def quit(self):
     """Resets the Arduino.
     Must be called when the program exits to reset the servos, or else the Arduino must be
     manually reset. The consequence of not doing this is that the Arduino will not drive the
     servos correctly. Invalidates all objects on an existing Arduino connection.
     """
     watchdog = Watchdog(self.__connection)
     watchdog.enable(0)
     time.sleep(0.2)
Exemple #2
0
def test2():
    watchdog = Watchdog(connection=None)
    watchdog.reset()
    watchdog.enable(watchdog.WDTO_1S)
    watchdog.disable()
Exemple #3
0
def setup():
    Watchdog.soft_reset()
 def watchdog(self):
     """Direct access to watchdog timer."""
     return Watchdog(self.connection)
Exemple #5
0
"""soft reset demo."""

from nanpy.watchdog import Watchdog
from nanpy.arduino import Arduino


def print_millis():
    print ('uptime: %s sec' % (Arduino.millis() / 1000.0))

print_millis()
print ('soft reset')
Watchdog.soft_reset()
print_millis()