Skip to content

Commit

Permalink
modify: 增加测试内容
Browse files Browse the repository at this point in the history
Changes to be committed:
	modified:   README.md
	new file:   img/test-dut-esp32.gif
	new file:   img/test-dut-esp32.jpg
  • Loading branch information
peter committed Sep 17, 2023
1 parent 5baecb9 commit 623bc2e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,39 @@
![BOTTOM](img/bottom.jpg)

![CH347扩展](img/CH347扩展.jpg)

## 测试

![测量ESP32模块](img/test-dut-esp32.jpg)

简单测试:

```python
sensor = INA226()
print(sensor.get_config())
sensor.set_alert_limit(0x1000)
print(sensor.get_calibration())
print(sensor.get_shunt_voltage(), 'uV')
print(sensor.get_bus_voltage(), 'mV')
print(sensor.get_current(), 'uA')
print(sensor.get_power(), 'mW')
sensor.set_mask_enable('SOL')
print(sensor.get_mask_enable())
sensor.close()
```

输出:

```powershell
{'reset': False, 'avg': 0, 'vbus_ct': 4, 'vsh_ct': 4, 'mode': 7}
2048
522.5 uV
5040.0 mV
26125.0 uA
134.375 mW
{'SOL': True, 'SUL': False, 'BOL': False, 'BUL': False, 'POL': False, 'CNVR': False, 'AFF': False, 'CVRF': True, 'OVF': False, 'APOL': False, 'LEN': False}
```

动态测试:

![10Hz采样率测量ESP32模块](img/test-dut-esp32.gif)
Binary file added img/test-dut-esp32.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/test-dut-esp32.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 623bc2e

Please sign in to comment.