@@ -9,29 +9,44 @@ This driver depends on:
99
1010This is easy to install with the following command.
1111 ```
12+
1213curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
14+
1315 ```
1416
1517## Installing from PyPI
1618
1719On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
1820
1921```
22+
2023pip3 install seeed-python-mlx90640
24+
2125```
2226
2327To install system-wide (this may be required in some cases):
2428
2529```
30+
2631sudo pip3 install seeed-python-mlx90640
32+
33+ ```
34+
35+ if you want to update the driver locally from PyPI. you can use:
36+
37+ ```
38+ pip3 install --upgrade seeed-python-mlx90640
2739```
2840
2941## Usage Notes
3042
3143First, Check the corresponding i2c number of the board:
44+
3245```
46+
3347(.env) pi@raspberrypi:~ $ ls /dev/i2c*
3448/dev/i2c-1
49+
3550```
3651
3752Check if the i2c device works properly, 0x33 is the MLX90640 i2c address.
@@ -56,13 +71,13 @@ Initialize the sersor object and config the sersor refresh rate.
5671
5772``` python
5873import seeed_mlx90640
59- sensor = seeed_mlx90640.grove_mxl90640()
60- sensor.SetRefreshRate( 0x 04 )
74+ mlx = seeed_mlx90640.grove_mxl90640()
75+ mlx.refresh_rate = seeed_mlx90640.RefreshRate. REFRESH_8_HZ # The fastest for raspberry 4
6176# 0x00 0.5HZ
6277# 0x01 1HZ
6378# 0x02 2HZ
64- # 0x03 4HZ(recommend for raspberry)
65- # 0x04 8HZ
79+ # 0x03 4HZ
80+ # 0x04 8HZ(recommend for raspberry)
6681# 0x05 16HZ
6782# 0x06 32HZ
6883# 0x07 64HZ
@@ -73,27 +88,18 @@ sensor.SetRefreshRate(0x04)
7388To read from the sensor:
7489
7590``` python
76- Pixel = [0 ]* 801
77- for i in range (0 ,801 ):
78- Pixel[i] = sensor.getCompensatedPixData(i// 32 ,i% 32 )
79- del Pixel[0 :33 ]
80- print (len (Pixel)) # 24x32 pixel
81- print (Pixel)
91+ try :
92+ mlx.getFrame(frame)
93+ except ValueError :
94+ continue
8295```
8396
84- If you're just using the MLX90640 on iic.You can add content that below to the config.txt.
85-
86- ``` bash
87- dtparam=i2c_arm=on,i2c_arm_baudrate=1000000
88- ```
89-
90- This will give you a framerate of - at most - 32FPS.
91-
92- and If you have other iic device ,maybe you can add content that below to the config.txt to get the fastest rate recommended for compatibility
97+ maybe you can add content that below to the config.txt to get the fastest rate recommended for compatibility
9398
9499``` bash
95100dtparam=i2c_arm=on,i2c_arm_baudrate=400000
96101```
102+
97103This will give you a framerate of - at most - 8FPS.
98104
99105## Contributing
0 commit comments