Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_test_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
python_test_scripts
Commits
c35f5f16
Commit
c35f5f16
authored
Aug 3, 2021
by
Gijs Schoonderbeek
Browse files
Options
Downloads
Patches
Plain Diff
Updated APSPU scripts after test with USB-I2C device on labtop.
parent
08c11abe
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
I2C_serial.py
+1
-1
1 addition, 1 deletion
I2C_serial.py
rd_apspu.py
+11
-9
11 additions, 9 deletions
rd_apspu.py
with
12 additions
and
10 deletions
I2C_serial.py
+
1
−
1
View file @
c35f5f16
...
...
@@ -11,7 +11,7 @@ DEBUG=False
ser
=
serial
.
Serial
()
ser
.
baudrate
=
57600
ser
.
port
=
'
COM
11
'
ser
.
port
=
'
COM
4
'
ser
.
parity
=
serial
.
PARITY_NONE
ser
.
timeout
=
1
...
...
This diff is collapsed.
Click to expand it.
rd_apspu.py
+
11
−
9
View file @
c35f5f16
...
...
@@ -22,9 +22,9 @@ sys.path.insert(0, '.')
import
os
# import time
from
APSPU_I2C
import
*
if
os
.
name
==
"
posix
"
:
from
I2C_serial_pi
import
*
else
:
#
if os.name == "posix":
#
from I2C_serial_pi import *
#
else:
from
I2C_serial
import
*
...
...
@@ -83,6 +83,7 @@ class ApspuClass:
#
# Function to read all monitoring points of the UniBoard
#
print
(
"
Read POLs
"
)
for
pol
in
self
.
pols
:
pol
.
read_all
()
return
True
...
...
@@ -112,7 +113,7 @@ class PolClass:
self
.
vout
=
0
self
.
iout
=
0
self
.
temp
=
0
self
.
pol_dev
=
I2C
(
LOC
_POLS
[
self
.
name
])
self
.
pol_dev
=
I2C
(
CTR
_POLS
[
self
.
name
])
self
.
pol_dev
.
bus_nr
=
I2CBUSNR
ret_ack
,
ret_value
=
self
.
pol_dev
.
read_bytes
(
1
)
if
ret_ack
<
1
:
...
...
@@ -189,10 +190,11 @@ def main():
# Function to test the class, read all info and dump on the screen
#
apspu
=
ApspuClass
()
if
apspu
.
wr_rd_eeprom
(
value
=
0x34
):
print
(
"
read / write EEPROM
"
)
apspu
.
wr_rd_eeprom
(
value
=
0x34
)
apspu
.
read_all
()
apspu
.
print_status
()
if
__name__
==
"
__main__
"
:
main
\ No newline at end of file
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment