Skip to content

Instantly share code, notes, and snippets.

View JeanCarlosChavarriaHughes's full-sized avatar
🎯
Focusing

JeanC Ch. H. JeanCarlosChavarriaHughes

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
import minimalmodbus
import serial
powerMeter = minimalmodbus.Instrument('/dev/ttyUSB0', 1)
powerMeter.serial.baudrate = 9600
powerMeter.serial.bytesize = 8
powerMeter.serial.parity = serial.PARITY_NONE
powerMeter.serial.stopbits = 1
powerMeter.mode = minimalmodbus.MODE_RTU