File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def pixels(self):
149
149
Temperatures are stored in a two dimensional list where the first index is the row and
150
150
the second is the column. The first row is on the side closest to the writing on the
151
151
sensor."""
152
- retbuf = [[0 ]* _PIXEL_ARRAY_WIDTH ] * _PIXEL_ARRAY_HEIGHT
152
+ retbuf = [[0 ]* _PIXEL_ARRAY_WIDTH for _ in range ( _PIXEL_ARRAY_HEIGHT )]
153
153
buf = bytearray (3 )
154
154
155
155
with self .i2c_device as i2c :
@@ -161,7 +161,6 @@ def pixels(self):
161
161
i2c .readinto (buf , start = 1 )
162
162
163
163
raw = (buf [2 ] << 8 ) | buf [1 ]
164
- converted = _signed_12bit_to_float (raw ) * _PIXEL_TEMP_CONVERSION
165
- retbuf .append (converted )
164
+ retbuf [row ][col ] = _signed_12bit_to_float (raw ) * _PIXEL_TEMP_CONVERSION
166
165
167
166
return retbuf
You can’t perform that action at this time.
0 commit comments