This repository has been archived by the owner on Dec 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
time_lock implemented need to be tested
- Loading branch information
Rodriguez
committed
Oct 19, 2023
1 parent
00db8ba
commit fb38eae
Showing
10 changed files
with
110 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
# =================================================================== | ||
# PARAMETERS | ||
PYTHON_VENV_PATH=/usr/local/bin/panduza/venv | ||
|
||
# =================================================================== | ||
|
||
${PYTHON_VENV_PATH}/bin/python3 $1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import time | ||
import numpy as np | ||
from panduza import Bpc | ||
|
||
ADDR="localhost" | ||
PORT=1883 | ||
|
||
# power_channel = Bpc(addr=ADDR, port=PORT, topic="pza/default/Hanmatek_Hm310t/bpc") | ||
# power_channel = Bpc(addr=ADDR, port=PORT, topic="pza/default/Panduza_FakeBps/channel_1") | ||
# power_channel = Bpc(addr=ADDR, port=PORT, topic="pza/default/Tenma_722710/bpc") | ||
# power_channel = Bpc(addr=ADDR, port=PORT, topic="pza/default/fake/:channel_0:_ctrl") | ||
power_channel = Bpc(addr=ADDR, port=PORT, topic="pza/default/xavier/:channel_0:_ctrl") | ||
|
||
|
||
# Read from interface | ||
MIN_VOLTAGE=0 | ||
MAX_VOLTAGE=10 | ||
STP_VOLTAGE=0.1 | ||
DEC_VOLTAGE=1 | ||
|
||
|
||
|
||
for i in range(0, 20): | ||
state_value = bool(i%2) | ||
print(f"set enable {state_value}") | ||
power_channel.enable.value.set(state_value) | ||
|
||
|
||
for voltage in np.arange(MIN_VOLTAGE, MAX_VOLTAGE, STP_VOLTAGE): | ||
voltage = round(voltage, DEC_VOLTAGE) | ||
print(f"set voltage {voltage}V") | ||
power_channel.voltage.value.set(voltage, ensure=True) | ||
|
||
|
||
for voltage in np.arange(MIN_VOLTAGE, MAX_VOLTAGE, STP_VOLTAGE): | ||
voltage = round(voltage, DEC_VOLTAGE) | ||
print(f"set voltage {voltage}V") | ||
power_channel.voltage.value.set(voltage, ensure=False) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
|
||
print("===") | ||
for topic, info in interfaces.items(): | ||
print(topic, " - ", info) | ||
print(topic, " - ", info) | ||
|
This file was deleted.
Oops, something went wrong.