Skip to content

Commit 0ca1a1e

Browse files
clawpiladyada
andcommitted
Revert direct pushes - will re-submit via PR
Co-authored-by: ladyada <limor@ladyada.net>
1 parent 3a5534f commit 0ca1a1e

4 files changed

Lines changed: 24 additions & 193 deletions

File tree

examples/01_simpletest/01_simpletest.ino

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
#include <Adafruit_TMF8828.h>
1414

15-
#define TMF8828_EN_PIN 3 // GPIO pin connected to TMF8828 EN, or -1 to skip
16-
17-
Adafruit_TMF8828 tmf(TMF8828_EN_PIN);
15+
Adafruit_TMF8828 tmf;
1816

1917
static tmf8828_frame_t frame;
2018

@@ -57,15 +55,24 @@ void loop() {
5755
Serial.print(frame.temperature);
5856
Serial.println(F("C"));
5957

60-
Serial.println(F("Distance (mm): Confidence:"));
58+
Serial.println(F("Distance (mm):"));
6159
for (uint8_t row = 0; row < 8; row++) {
6260
Serial.print(F(" "));
6361
for (uint8_t col = 0; col < 8; col++) {
6462
printPadded(frame.distances[row][col], 5);
63+
if (col < 7)
64+
Serial.print(F(" "));
6565
}
66-
Serial.print(F(" "));
66+
Serial.println();
67+
}
68+
69+
Serial.println(F("Confidence:"));
70+
for (uint8_t row = 0; row < 8; row++) {
71+
Serial.print(F(" "));
6772
for (uint8_t col = 0; col < 8; col++) {
68-
printPadded(frame.confidences[row][col], 4);
73+
printPadded(frame.confidences[row][col], 3);
74+
if (col < 7)
75+
Serial.print(F(" "));
6976
}
7077
Serial.println();
7178
}

hw_tests/raw_obj_dump/parse_8x8.py

Lines changed: 0 additions & 118 deletions
This file was deleted.

hw_tests/raw_obj_dump/raw_obj_dump.ino

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/Adafruit_TMF8828.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,22 +197,22 @@ bool Adafruit_TMF8828::readFrame(tmf8828_frame_t* frame) {
197197
memset(&_frame, 0, sizeof(_frame));
198198
}
199199

200-
// Each subcapture has 36 results in 4 groups of 9. The LAST entry of each
201-
// group (indices 8, 17, 26, 35) is the reference channel. Stripping those
202-
// gives 32 real zones: first 16 = object 0, second 16 = object 1.
203-
// The 16 zones per subcapture map to specific 8x8 positions via the
204-
// official ams-OSRAM remap table (from tmf882x descattering filter).
200+
// Each subcapture has 36 results in 4 groups of 9. The first entry of each
201+
// group (indices 0, 9, 18, 27) is a reference channel. Stripping those gives
202+
// 32 real zones: first 16 = object 0, second 16 = object 1. We use object 0.
203+
// The 16 zones per subcapture map to specific 8x8 positions via a
204+
// checkerboard-like interleave (from ams-OSRAM TMF8828 zone mapping).
205205
static const uint8_t PROGMEM zoneMap[4][16] = {
206-
{56, 60, 40, 44, 24, 28, 8, 12, 57, 61, 41, 45, 25, 29, 9, 13},
207-
{58, 62, 42, 46, 26, 30, 10, 14, 59, 63, 43, 47, 27, 31, 11, 15},
208-
{48, 52, 32, 36, 16, 20, 0, 4, 49, 53, 33, 37, 17, 21, 1, 5},
209-
{50, 54, 34, 38, 18, 22, 2, 6, 51, 55, 35, 39, 19, 23, 3, 7},
206+
{8, 9, 12, 13, 24, 25, 28, 29, 40, 41, 44, 45, 56, 57, 60, 61},
207+
{10, 11, 14, 15, 26, 27, 30, 31, 42, 43, 46, 47, 58, 59, 62, 63},
208+
{0, 1, 4, 5, 16, 17, 20, 21, 32, 33, 36, 37, 48, 49, 52, 53},
209+
{2, 3, 6, 7, 18, 19, 22, 23, 34, 35, 38, 39, 50, 51, 54, 55},
210210
};
211211

212212
uint8_t zoneIdx = 0;
213213
for (uint8_t i = 0; i < 36; i++) {
214-
if ((i % 9) == 8) {
215-
continue; // skip reference channel (last in each group of 9)
214+
if ((i % 9) == 0) {
215+
continue; // skip reference channel
216216
}
217217
if (zoneIdx < 16) {
218218
uint8_t gridIdx = pgm_read_byte(&zoneMap[sub][zoneIdx]);

0 commit comments

Comments
 (0)