Simple spectrum analyser using the RSSI measurements of the RF22 (see Sample output showing a plot from 395.0MHz to 396.0MHz of a signal generator at 395.5MHz amplitude modulated at 100% 1kHz)
#include <RF22.h>
#include <SPI.h>
void setup()
{
Serial.begin(115200);
Serial.println("RF22 init failed");
}
float start = 395.0;
float end = 396.0;
float step = 0.02;
void loop()
{
float freq;
Serial.println("\033[H");
for (freq = start; freq < end; freq += step)
{
delay(10);
uint8_t stars = rssi / 8;
Serial.print(freq);
Serial.print(": ");
uint8_t i;
for (i = 0; i < stars; i++)
Serial.print('*');
Serial.print("\033[K");
Serial.println("");
}
Serial.println("------------------");
}