コード例 #1
0
ファイル: sleeve.py プロジェクト: lietk12/vera-sleeve
 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)
コード例 #2
0
def test2():
    watchdog = Watchdog(connection=None)
    watchdog.reset()
    watchdog.enable(watchdog.WDTO_1S)
    watchdog.disable()
コード例 #3
0
ファイル: test_arduino.py プロジェクト: llaurent/nanpy
def setup():
    Watchdog.soft_reset()
コード例 #4
0
 def watchdog(self):
     """Direct access to watchdog timer."""
     return Watchdog(self.connection)
コード例 #5
0
ファイル: reset.py プロジェクト: llaurent/nanpy
"""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()