forked from Solo-FL/SoloPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
23 lines (18 loc) · 751 Bytes
/
test.py
File metadata and controls
23 lines (18 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Copyright: (c) 2021, 2022, 2023 SOLO motor controllers project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Title: SoloPy
# Author: SOLOMotorControllers
# Date: 2023
# Code version: 3.1.0
# Availability: https://github.com/Solo-FL/SoloPy/tree/main/SoloPy
# This Library is made by SOLOMotorControllers.COM
# please visit: https://www.SOLOMotorControllers.com/
import SoloPy as solo
import time
# sudo ip link set can0 up type can bitrate 1000000
# mySolo = solo.SOLOMotorControllersCanopen(0,solo.CAN_BUS_BAUD_RATE.RATE_1000 )
mySolo = solo.SoloMotorControllerUart("/dev/ttyS0",0, UART_BAUD_RATE.RATE_937500,1)
while True:
a, b = mySolo.get_bus_voltage()
print(a, b)
time.sleep(1)