Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
osie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Manchev
osie
Commits
af1db049
Commit
af1db049
authored
Jul 10, 2020
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start work on modus. switch all relays.
parent
ed8ae026
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
examples/lime2-mod-io-relay-on_off.py
examples/lime2-mod-io-relay-on_off.py
+3
-2
No files found.
examples/lime2-mod-io-relay-on_off.py
View file @
af1db049
...
@@ -47,6 +47,7 @@ olimex@a20-olinuxino:~$ sudo bash
...
@@ -47,6 +47,7 @@ olimex@a20-olinuxino:~$ sudo bash
root@a20-olinuxino:~# apt install htop tig git etckeeper vim curl python3 python3-venv python3-pip
root@a20-olinuxino:~# apt install htop tig git etckeeper vim curl python3 python3-venv python3-pip
root@a20-olinuxino:~# python3 -m pip install --upgrade pip setuptools wheel
root@a20-olinuxino:~# python3 -m pip install --upgrade pip setuptools wheel
root@a20-olinuxino:~# pip3 install pyA20Lime2
root@a20-olinuxino:~# pip3 install pyA20Lime2
root@a20-olinuxino:~# pip3 install -U pymodbus
# enable i2c-1 by running and selecting it (temporary step until fixed by Olimex but not needed for debian 10!)
# enable i2c-1 by running and selecting it (temporary step until fixed by Olimex but not needed for debian 10!)
root@a20-olinuxino:~# olinuxino-overlay
root@a20-olinuxino:~# olinuxino-overlay
...
@@ -82,14 +83,14 @@ i2c.init("/dev/i2c-1")
...
@@ -82,14 +83,14 @@ i2c.init("/dev/i2c-1")
i2c
.
open
(
0x58
)
i2c
.
open
(
0x58
)
# switch ON RELAY1
# switch ON RELAY1
i2c
.
write
([
0x10
,
0x0
1
])
i2c
.
write
([
0x10
,
0x0
F
])
for
i
in
range
(
0
,
30
*
60
*
24
):
for
i
in
range
(
0
,
30
*
60
*
24
):
# switch OFF RELAY1
# switch OFF RELAY1
i2c
.
write
([
0x10
,
0x00
])
i2c
.
write
([
0x10
,
0x00
])
time
.
sleep
(
2
)
time
.
sleep
(
2
)
# switch ON RELAY1
# switch ON RELAY1
i2c
.
write
([
0x10
,
0x0
1
])
i2c
.
write
([
0x10
,
0x0
F
])
time
.
sleep
(
1
)
time
.
sleep
(
1
)
...
...
Write
Preview
Markdown
is supported
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