Search found 28 matches

by chrisb2
Tue May 02, 2023 9:01 am
Forum: Drivers for External Components
Topic: Micropython library for the TI INA219 voltage/current sensor
Replies: 26
Views: 174609

Re: Micropython library for the TI INA219 voltage/current sensor

Probably you should raise an issue against my library (https://github.com/chrisb2/pyb_ina219/issues) if believe its wrong, rarther that further discussion in this old topic in a deprecated forum.

Chris
by chrisb2
Tue May 02, 2023 8:54 am
Forum: Drivers for External Components
Topic: Micropython library for the TI INA219 voltage/current sensor
Replies: 26
Views: 174609

Re: Micropython library for the TI INA219 voltage/current sensor

Can you tell me where in the datasheet for the ina219 (https://www.ti.com/lit/ds/symlink/ina219.pdf) you saw 2.5uV? I see 10uV in the Electrical Characteristics table on page 5 where it say 10uV in the DC Accuracy section.

Chris
by chrisb2
Thu Sep 16, 2021 7:31 am
Forum: General Discussion and Questions
Topic: Multiline f strings in v1.17 - syntax error
Replies: 12
Views: 7800

Re: Multiline f strings in v1.17 - syntax error

Based on the feedback I have updated my code to:

Code: Select all

def timestamp():
    """Get current timezone date/time from RTC as DD-MM-YYYY HH24:MM:SS."""
    dt = datetime()
    return f"{dt.day:02d}-{dt.month:02d}-{dt.year:d} " +\
           f"{dt.hour:02d}:{dt.minute:02d}:{dt.second:02d}"
by chrisb2
Wed Sep 15, 2021 5:14 am
Forum: General Discussion and Questions
Topic: Multiline f strings in v1.17 - syntax error
Replies: 12
Views: 7800

Re: Multiline f strings in v1.17 - syntax error

This comes from my own code, where the following function is part of a module which talks to a DS3231 RTC: def timestamp(): """Get current timezone date/time from RTC as DD-MM-YYYY HH24:MM:SS.""" dt = datetime() return '%02d-%02d-%d %02d:%02d:%02d' % \ (dt.day, dt.month, dt.year, dt.hour, dt.minute,...
by chrisb2
Mon Sep 13, 2021 8:12 am
Forum: General Discussion and Questions
Topic: Multiline f strings in v1.17 - syntax error
Replies: 12
Views: 7800

Multiline f strings in v1.17 - syntax error

I have some existing string formatting I tried to convert to an f string, but it would be longer than the pep8 line size limit, so I tried to use a multiline string (as per solution 1 of https://izziswift.com/multiline-f-string-in-python/ ) as follows: x = 1 y = 2 a = ( f"{x}" f"{y}" ) but this give...
by chrisb2
Thu May 21, 2020 8:25 am
Forum: Drivers for External Components
Topic: Micropython library for the TI INA219 voltage/current sensor
Replies: 26
Views: 174609

Re: Micropython library for the TI INA219 voltage/current sensor

I had a quick look at ina226 datasheet and it seems to me to be pretty similar to ina219, it might not be to hard to make appropriate changes to my library by carefully reading both data sheets. I would pay particular attention to the calibration algorithm. Micropython to Python should not be hard, ...
by chrisb2
Mon Mar 25, 2019 5:12 am
Forum: ESP32 boards
Topic: powering ESP32 with a battery
Replies: 12
Views: 18897

Re: powering ESP32 with a battery

The battery is https://www.jaycar.co.nz/18650-lifepo4-battery-1600mah-3-2v/p/SB2307 . You need a charger specifically designed for LiFePO4 batteries, the ordinary LiPo chargers will generate too high a voltage they are full at 4.2V, whereas LiFePO4 are full at 3.65V. My charger is an https://www.ali...
by chrisb2
Sun Mar 24, 2019 6:36 am
Forum: ESP32 boards
Topic: powering ESP32 with a battery
Replies: 12
Views: 18897

Re: powering ESP32 with a battery

I have had no problems with LiFePo4 batteries in this project: https://github.com/chrisb2/water-system Which uses a single directly connected battery. It wakes once a day and battery life seems to be about 3 months. The batteries I have have been recharged numerous times, even including recovering f...