Skip to content

Commit 0c3a01a

Browse files
committed
test neopixel and init radio
1 parent c33c478 commit 0c3a01a

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

Factory_Tests/Feather_RP2040_RFM69/.feather_rp2040_rfm.test.only

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

0 commit comments

Comments
 (0)