Created
June 23, 2010 14:00
-
-
Save ka010/449955 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basic example of how to use avrBridgePy. | |
# once you have a reference to the wrapped library, | |
# you can use the API defined in avrBridgeC.h | |
# | |
# this example blinks an led on portD - pin0 | |
import time | |
import avrBridgePy as avrBridgePy | |
#get a wrapper instance | |
bridge = avrBridgePy.avrBridge() | |
#get a direct reference to libavrBridgeC | |
mega = bridge.mega | |
#configure pinD0 as output | |
mega.setPortPinDir(bridge.PORTD, 0, bridge.OUT) | |
#loop | |
while True: | |
print "ON" | |
mega.setPortPin(bridge.PORTD, 0, bridge.ON) | |
time.sleep(1) | |
print "OFF" | |
mega.setPortPin(bridge.PORTD, 0, bridge.OFF) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment