DFRobot V2 screen

This commit is contained in:
Ferny G
2020-04-17 09:27:58 -05:00
committed by dadav
parent 2b17e5322b
commit 8c2b4e2075
36 changed files with 1537 additions and 11 deletions

View File

@ -0,0 +1,21 @@
# -*- coding:utf-8 -*-
'''
change i2c frequency on raspberry:
1. edit /etc/modprobe.d
2. add line:
options i2c_bcm2708 baudrate=400000
'''
import smbus
class I2C:
def __init__(self, port):
self._bus = smbus.SMBus(port)
def writeBytes(self, addr, reg, buf):
self._bus.write_block_data(addr, reg, buf)
def readBytes(self, addr, reg, length):
return self._bus.read_block_data(addr, reg, length)