Mercurial > templog
comparison py/gpio_test.py @ 530:73257bae83ea
fix a few python3 issues
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 11 Apr 2015 00:16:05 +0800 |
parents | dd8895652485 |
children |
comparison
equal
deleted
inserted
replaced
529:5201f441bf4a | 530:73257bae83ea |
---|---|
12 L("Test GPIO %s pin %d started, set off." % (name, pin)) | 12 L("Test GPIO %s pin %d started, set off." % (name, pin)) |
13 | 13 |
14 def turn(self, value): | 14 def turn(self, value): |
15 self.state = bool(value) | 15 self.state = bool(value) |
16 onoff = ("off", "on")[int(self.state)] | 16 onoff = ("off", "on")[int(self.state)] |
17 L("Test GPIO %s pin %d turned %s" % (self.name, self.pin, onoff)) | 17 L("Test GPIO %s pin %s turned %s" % (self.name, self.pin, onoff)) |
18 | 18 |
19 def get_state(self): | 19 def get_state(self): |
20 return self.state | 20 return self.state |
21 | 21 |
22 | 22 |