Skip to content

Commit e3d4a71

Browse files
authored
Merge pull request #2472 from ladyada/main
rfm factorytest
2 parents 360557a + d71531e commit e3d4a71

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

Factory_Tests/Feather_ESP32S3_ReverseTFT_FactoryTest/Feather_ESP32S3_ReverseTFT_FactoryTest.ino

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ GFXcanvas16 canvas(240, 135);
2222
void setup() {
2323
Serial.begin(115200);
2424
//while (! Serial) delay(10);
25-
2625
delay(100);
2726

2827
TB.neopixelPin = PIN_NEOPIXEL;
@@ -69,9 +68,22 @@ void setup() {
6968
uint8_t j = 0;
7069

7170
void loop() {
71+
bool valid_i2c[128];
7272
Serial.println("**********************");
7373

74-
TB.printI2CBusScan();
74+
if (j == 0) {
75+
Serial.print("I2C scan: ");
76+
for (int i=0; i< 128; i++) {
77+
if (TB.scanI2CBus(i, 0)) {
78+
Serial.print("0x");
79+
Serial.print(i, HEX);
80+
Serial.print(", ");
81+
valid_i2c[i] = true;
82+
} else {
83+
valid_i2c[i] = false;
84+
}
85+
}
86+
}
7587

7688
if (j % 2 == 0) {
7789
canvas.fillScreen(ST77XX_BLACK);
@@ -91,7 +103,7 @@ void loop() {
91103
canvas.print("I2C: ");
92104
canvas.setTextColor(ST77XX_WHITE);
93105
for (uint8_t a=0x01; a<=0x7F; a++) {
94-
if (TB.scanI2CBus(a, 0)) {
106+
if (valid_i2c[a]) {
95107
canvas.print("0x");
96108
canvas.print(a, HEX);
97109
canvas.print(", ");

Factory_Tests/Feather_RP2040_RFM69/.feather_rp2040_rfm.test.only

Whitespace-only changes.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// SPDX-FileCopyrightText: 2023 Limor Fried for Adafruit Industries
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
// rf69 demo tx rx.pde
6+
// -*- mode: C++ -*-
7+
// Example sketch showing how to create a simple messageing client
8+
// with the RH_RF69 class. RH_RF69 class does not provide for addressing or
9+
// reliability, so you should only use RH_RF69 if you do not need the higher
10+
// level messaging abilities.
11+
// It is designed to work with the other example rf69_server.
12+
// Demonstrates the use of AES encryption, setting the frequency and modem
13+
// configuration
14+
15+
#include <RH_RF69.h>
16+
#include "Adafruit_TestBed.h"
17+
18+
extern Adafruit_TestBed TB;
19+
20+
// Singleton instance of the radio driver
21+
RH_RF69 rf69(PIN_RFM_CS, PIN_RFM_DIO0);
22+
23+
void setup()
24+
{
25+
Serial.begin(115200);
26+
27+
pinMode(PIN_LED, OUTPUT);
28+
pinMode(PIN_RFM_RST, OUTPUT);
29+
digitalWrite(PIN_RFM_RST, LOW);
30+
31+
TB.neopixelPin = PIN_NEOPIXEL;
32+
TB.neopixelNum = 1;
33+
TB.begin();
34+
35+
Serial.println("Feather RFM69 Feather Self-test!");
36+
Serial.println();
37+
}
38+
39+
uint8_t x = 0;
40+
41+
void loop() {
42+
TB.setColor(TB.Wheel(x++));
43+
44+
if (x == 255) {
45+
// manual reset
46+
digitalWrite(PIN_RFM_RST, HIGH);
47+
delay(10);
48+
digitalWrite(PIN_RFM_RST, LOW);
49+
delay(10);
50+
51+
if (!rf69.init()) {
52+
Serial.println("RFM69 radio init failed");
53+
while (1);
54+
}
55+
Serial.println("RFM69 radio init OK!");
56+
}
57+
58+
delay(10);
59+
}

0 commit comments

Comments
 (0)