Skip to content

Commit

Permalink
test script for custom IC
Browse files Browse the repository at this point in the history
  • Loading branch information
mamin27 committed Sep 5, 2024
1 parent 1e8bf0f commit c92ac82
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions python_test_scripts/ecomet/ecomet01_i2c_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3

import sys,os
sys.path.append(os.getenv("HOME") + '/ecomet_i2c_raspberry_tools/ecomet_i2c_sensors')
from ecomet import ecomet01, ecomet01_constant

import logging

logging.basicConfig(level=logging.DEBUG, # change level looging to (INFO, DEBUG, ERROR)
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
filename='ecomet01.log',
filemode='a')
console = logging.StreamHandler()
console.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
console.setFormatter(formatter)
logging.getLogger('').addHandler(console)

sens = ecomet01.ECOMET01()
sens._logger = logging.getLogger('ecomet.ecomet01')
sens._logger.info('Start logging ...')

data = sens.read_register ( register = 'READ2' )

sens._logger.info('Read Reg: (%s)', data)

0 comments on commit c92ac82

Please sign in to comment.