Merge pull request #2472 from ladyada/main

rfm factorytest
This commit is contained in:
Kattni 2023-04-05 14:39:16 -04:00 committed by GitHub
commit e3d4a7172f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 3 deletions

View file

@ -22,7 +22,6 @@ GFXcanvas16 canvas(240, 135);
void setup() {
Serial.begin(115200);
//while (! Serial) delay(10);
delay(100);
TB.neopixelPin = PIN_NEOPIXEL;
@ -69,9 +68,22 @@ void setup() {
uint8_t j = 0;
void loop() {
bool valid_i2c[128];
Serial.println("**********************");
TB.printI2CBusScan();
if (j == 0) {
Serial.print("I2C scan: ");
for (int i=0; i< 128; i++) {
if (TB.scanI2CBus(i, 0)) {
Serial.print("0x");
Serial.print(i, HEX);
Serial.print(", ");
valid_i2c[i] = true;
} else {
valid_i2c[i] = false;
}
}
}
if (j % 2 == 0) {
canvas.fillScreen(ST77XX_BLACK);
@ -91,7 +103,7 @@ void loop() {
canvas.print("I2C: ");
canvas.setTextColor(ST77XX_WHITE);
for (uint8_t a=0x01; a<=0x7F; a++) {
if (TB.scanI2CBus(a, 0)) {
if (valid_i2c[a]) {
canvas.print("0x");
canvas.print(a, HEX);
canvas.print(", ");

View file

@ -0,0 +1,59 @@
// SPDX-FileCopyrightText: 2023 Limor Fried for Adafruit Industries
//
// SPDX-License-Identifier: MIT
// rf69 demo tx rx.pde
// -*- mode: C++ -*-
// Example sketch showing how to create a simple messageing client
// with the RH_RF69 class. RH_RF69 class does not provide for addressing or
// reliability, so you should only use RH_RF69 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example rf69_server.
// Demonstrates the use of AES encryption, setting the frequency and modem
// configuration
#include <RH_RF69.h>
#include "Adafruit_TestBed.h"
extern Adafruit_TestBed TB;
// Singleton instance of the radio driver
RH_RF69 rf69(PIN_RFM_CS, PIN_RFM_DIO0);
void setup()
{
Serial.begin(115200);
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_RFM_RST, OUTPUT);
digitalWrite(PIN_RFM_RST, LOW);
TB.neopixelPin = PIN_NEOPIXEL;
TB.neopixelNum = 1;
TB.begin();
Serial.println("Feather RFM69 Feather Self-test!");
Serial.println();
}
uint8_t x = 0;
void loop() {
TB.setColor(TB.Wheel(x++));
if (x == 255) {
// manual reset
digitalWrite(PIN_RFM_RST, HIGH);
delay(10);
digitalWrite(PIN_RFM_RST, LOW);
delay(10);
if (!rf69.init()) {
Serial.println("RFM69 radio init failed");
while (1);
}
Serial.println("RFM69 radio init OK!");
}
delay(10);
}