Skip to content

Commit dc966ca

Browse files
committed
converted to py3
1 parent c4040ee commit dc966ca

File tree

9 files changed

+25
-15
lines changed

9 files changed

+25
-15
lines changed

RPi/GPIO/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from hardware_manager.RPi.GPIO.definitions import *
1+
from .definitions import *
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from hardware_manager.RPi.GPIO.definitions.PWM.PWM import *
1+
from .PWM import *

RPi/GPIO/definitions/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from hardware_manager.RPi.GPIO.definitions.PWM import *
2-
from hardware_manager.RPi.GPIO.definitions.constants import *
3-
from hardware_manager.RPi.GPIO.definitions.functions import *
1+
from .PWM import *
2+
from .constants import *
3+
from .functions import *
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from hardware_manager.RPi.GPIO.definitions.functions.common import *
2-
from hardware_manager.RPi.GPIO.definitions.functions.input import *
3-
from hardware_manager.RPi.GPIO.definitions.functions.output import *
4-
from hardware_manager.RPi.GPIO.definitions.functions.setup import *
1+
from .common import *
2+
from .input import *
3+
from .output import *
4+
from .setup import *

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Hardware manager: a module for handling generic pieces of hardware connected to a RPi"""
22

3-
from manager import HardwareManager
3+
from hardware_manager.manager import HardwareManager

components/output/led.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
1010
"""
1111

12-
1312
import hardware_manager.components.virtual_component as virtual_component
1413
import hardware_manager.components.pin as pin
1514

@@ -38,7 +37,7 @@ def off(self):
3837

3938
def switch(self):
4039
"""Flip the LED"""
41-
print "flipping led"
40+
print("flipping led")
4241
self[0].flip()
4342

4443
def update(self, ignore=True, *args, **kwargs):

components/pin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from hardware_manager.RPi import GPIO
2-
#import RPi.GPIO as GPIO release version
32

43
class Pin(object):
54
"""Representation of a physical pin on the board"""

examples/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Examples of basic code"""
2+
3+
import hardware_manager.examples.basic_blinker as basic_blinker
4+
5+
all_examples = {"basic_blinker":basic_blinker}

examples/basic_blinker.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
"""A Basic example on how to use a LED Blinker
2+
Run the blink function to start blinking a led
3+
The basic components are accessible:
4+
- H is the hardware manager
5+
- LB is the blinker with name "blinker"
6+
"""
7+
18
from hardware_manager.manager import HardwareManager
29
from hardware_manager.components.output.led import LED_blink
310

@@ -13,8 +20,8 @@ def blink():
1320
H.update()
1421
if (H.current_milli_time()-t0)%100 == 0:
1522
if do_print:
16-
print "Time elapsed: {}".format(H.current_milli_time()-t0)
17-
print "Blinker LED status: {}\n".format(H['blinker']())
23+
print("Time elapsed: {}".format(H.current_milli_time()-t0))
24+
print("Blinker LED status: {}\n".format(H['blinker']()))
1825
do_print = False
1926
else:
2027
do_print = True

0 commit comments

Comments
 (0)