Skip to content

Commit

Permalink
Remove application specific code from examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklik committed Nov 16, 2024
1 parent 9b93a79 commit 30c50b2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
3 changes: 2 additions & 1 deletion examples/SDP3x_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
i2c = {
#"port": port,
"device": "hid",
"serial": "00A59713"
#"serial": "00A59713"
},
bus = [
{
Expand All @@ -46,6 +46,7 @@
try:
dp, temp = sdp3x_sensor.readData()
print(temp, dp)
time.sleep(0.2)

# except KeyboardInterrupt:
# pass
Expand Down
31 changes: 21 additions & 10 deletions examples/lion_gauge_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,30 @@
port = eval(sys.argv[1])

#### Sensor Configuration ###########################################
#cfg = config.Config(
# i2c = {
# "port": port, # I2C bus number
# },
#
# bus = [
# {
# "type": "i2chub",
# "address": 0x73,
#
# "children": [
# {"name": "guage", "type": "lioncell", "channel": 7, },
# ],
# },
# ],
#)

cfg = config.Config(
i2c = {
"port": port, # I2C bus number
},

bus = [
{
"type": "i2chub",
"address": 0x73,

"children": [
{"name": "guage", "type": "lioncell", "channel": 7, },
],
{"name": "guage", "type": "lioncell", "channel": 7,
},
],
)
Expand Down Expand Up @@ -60,9 +71,9 @@
print(" ".join([hex(i) for i in flash]))

print("DesCap =", guage.DesignCapacity(), "mAh")
flash = guage.Chemistry()
print("Chemistry = ")
print(" ".join([hex(i) for i in flash]))
#flash = guage.Chemistry()
#print("Chemistry = ")
#print(" ".join([hex(i) for i in flash]))

try:
while True:
Expand Down

0 comments on commit 30c50b2

Please sign in to comment.