Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hacksaar
Sphinx
Commits
5e442672
Commit
5e442672
authored
Mar 11, 2015
by
Ralf
Browse files
pins: change default I2C state to 1
parent
67962c39
Changes
1
Hide whitespace changes
Inline
Side-by-side
busfahrer.py
View file @
5e442672
...
@@ -40,7 +40,7 @@ class I2C:
...
@@ -40,7 +40,7 @@ class I2C:
def
setPin
(
self
,
pin
,
state
):
def
setPin
(
self
,
pin
,
state
):
'''Set the gien pin: An (address, bit) pair'''
'''Set the gien pin: An (address, bit) pair'''
with
self
.
_lock
:
with
self
.
_lock
:
byte
=
self
.
_bytes
.
get
(
pin
.
addr
,
0x
00
)
byte
=
self
.
_bytes
.
get
(
pin
.
addr
,
0x
FF
)
# default: all-1. That's also the HW default state, inherently.
# set the bit
# set the bit
if
state
:
if
state
:
byte
|=
(
1
<<
pin
.
bit
)
byte
|=
(
1
<<
pin
.
bit
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment