Skip to content

Commit

Permalink
Merge pull request #41 from KOSASIH/deepsource-transform-9103953f
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 11, 2024
2 parents ebcb701 + 2dd8024 commit 00796b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hardware_interface/i2c_communication.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import smbus


def open_i2c_bus(bus_number):
# Open an I2C bus using smbus or Adafruit-I2C

bus = smbus.SMBus(bus_number)

return bus


def write_i2c_data(bus, address, data):
# Write data to an I2C device

bus.write_i2c_block_data(address, 0, data)


def read_i2c_data(bus, address, num_bytes):
# Read data from an I2C device

Expand Down

0 comments on commit 00796b7

Please sign in to comment.