Forgive me for obvious omissions, this is my first forum post but I'll do my best. Right now I'm following Bill Chappel's guide on building a basic "spirit box" radio scanner, using (originally) an Uno, a TEA5767 radio module, and a microphone module to listen for questions before starting a radio scan.
#include <TEA5767.h>
#include <radio.h>
#include <Wire.h>
/*
*/
TEA5767 radio; // define radio model
int LED1 = 13; // create a name for led1
int hold = 20; // hold is the delay time
int inc = 10; // how far to move when tunning
int start_FM = 8790; // US FM band start **87.7 excluded
int stop_FM = 10790; // US FM band stop
int breadboard = 12; // power pin to breadboard
int mic = 11; // microphone signal
int AntIn = 0; // antenna energy value 1 count = 1.1 / 1024 = 0.0010V
void setup() {
pinMode(LED1, OUTPUT); // on board led
pinMode(breadboard, OUTPUT); // define breadboard power
Wire.begin(); // start IC2 communication
digitalWrite(breadboard, HIGH); // power ON breadboard
radio.init(); // start radio
radio.setMute(1); // mute ON radio sound off
delay(100); // give breadboard chance to power on
}
void loop() {
delay (10); // allow analog time to settle
AntIn = analogRead(A0); // read energy on antenna
radio.setMute(1); // radio mute ON
int a = digitalRead(mic); // read mic to a
// to talk or not to talk
if ((AntIn > 340) or (a == 0)) { // if AntIn is greater than 340 or a = 1 mic on then scan
while (a == 0) { // while mic = 1 wait here
delay(5); //delay 5 ms
a = digitalRead(mic); // read mic to a
}
delay(500); // wait 1.5 seconds before responding
radio.setMute(0); // un-mute radio and allow it to scan
// for loop and scanning from start-FM to stop-FM stepping by inc value (In MHz)
for (int r = start_FM; r <= stop_FM; r = r + inc) {
digitalWrite(LED1, HIGH); // led ON
radio.setFrequency(r); // set radio to new frequency
delay(hold/2); // wait here for 1/2 hold time
digitalWrite(LED1, LOW); // led OFF
delay(hold/2); // wait here again
}
// for loop to scan backwards from stop_FM to start_FM with same stepping
for (int r = stop_FM-inc; r >= start_FM+inc; r = r - inc) { // +/- inc to prevent repeat stations
digitalWrite(LED1, HIGH); // led ON
radio.setFrequency(r); // change station
delay(hold/2);
digitalWrite(LED1, LOW);
delay(hold/2);
}
}
}
It works without issue on the Uno, but when trying to minimize the physical size and build up a strip board version of the circuit to run from a Nano Every instead, I'm getting an error that logs as "Multiple libraries found for wire.h" in the Web/Cloud IDE, and just as a "compilation error: exit status 1" in the program IDE. The verbose error log keeps mentioning issues with an "SI4703.h" in the Radio library. I'll add it here since it's not too long of an error log:
In file included from c:\users\nathan\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\io.h:99:0,
from c:\users\nathan\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino5\avr\include\avr\pgmspace.h:90,
from C:\Users\Nathan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.8\cores\arduino/api/String.h:31,
from C:\Users\Nathan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.8\cores\arduino/api/IPAddress.h:24,
from C:\Users\Nathan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.8\cores\arduino/api/ArduinoAPI.h:30,
from C:\Users\Nathan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.8\cores\arduino/Arduino.h:23,
from C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:17:
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:32:22: error: expected unqualified-id before 'volatile'
static const uint8_t GPIO1 = 0; // GPIO1
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:32:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:32:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:33:22: error: expected unqualified-id before 'volatile'
static const uint8_t GPIO2 = 2; // GPIO2
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:33:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:33:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:34:22: error: expected unqualified-id before 'volatile'
static const uint8_t GPIO3 = 4; // GPIO3
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:34:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src/SI4703.h:34:22: error: expected ')' before 'volatile'
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp: In member function 'void SI4703::writeGPIO(int, int)':
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:447:10: error: expression '*(volatile uint8_t*)29' has side-effects
case GPIO1:
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:447:10: error: 'reinterpret_cast<volatile uint8_t* {aka volatile unsigned char*}>(29)' is not a constant expression
case GPIO1:
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:451:10: error: expression '*(volatile uint8_t*)30' has side-effects
case GPIO2:
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:451:10: error: 'reinterpret_cast<volatile uint8_t* {aka volatile unsigned char*}>(30)' is not a constant expression
case GPIO2:
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:455:10: error: expression '*(volatile uint8_t*)31' has side-effects
case GPIO3:
^
C:\Users\Nathan\OneDrive\Documents\Arduino\libraries\Radio\src\SI4703.cpp:455:10: error: 'reinterpret_cast<volatile uint8_t* {aka volatile unsigned char*}>(31)' is not a constant expression
case GPIO3:
^
exit status 1
Compilation error: exit status 1
I've tried looking up every way I can think of to search for to find any similar issues, but none of them are close enough and the solutions I've tried anyway don't work.