Hi all.
got the error : Error compiling for board Arduino Uno.
just a short code, how?
thanks
Adam
TEA5767N radio = TEA5767N();
extern unsigned char BigNumbers[];
extern unsigned char TinyFont[];
extern uint8_t splash[];
extern uint8_t signal5[];
extern uint8_t signal4[];
extern uint8_t signal3[];
extern uint8_t signal2[];
extern uint8_t signal1[];
int analogPin = 0;
int val = 0;
int frequencyInt = 0;
float frequency = 0;
float previousFrequency = 0;
int signalStrength = 0;
#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
#define TFT_GREY 0x5AEB
void setup()
{
Serial.begin(115200);
// while (!Serial) ; // Needed for Leonardo only
Serial.print("File : "), Serial.println(__FILE__);
const char compile_date[] = __DATE__ " " __TIME__;
Serial.print("Compile timestamp: ");
Serial.println(compile_date);
tft.init();
tft.setRotation(0);
tft.setTextSize(1);
tft.fillScreen(TFT_BLACK);
tft.setCursor(0, 0, 2);
tft.print("DIY");
delay(2000);
tft.fillScreen(TFT_BLACK);
radio.setMonoReception();
radio.setStereoNoiseCancellingOn();
initScreen();
showSplashScreen();
}
void loop() {
for(int i;i<30;i++)
{
val = val + analogRead(analogPin);
delay(1);
}
val = val/30;
frequencyInt = map(val, 2, 1014, 8700, 10700); //Analog value to frequency from 87.0 MHz to 107.00 MHz
float frequency = frequencyInt/100.0f;
if(frequency - previousFrequency >= 0.1f || previousFrequency - frequency >= 0.1f)
{
// tft.clrScr();
radio.selectFrequency(frequency);
// printSignalStrength();
// printStereo();
printFrequency(frequency);
previousFrequency = frequency;
}
tft.fillScreen(TFT_BLACK);
// printSignalStrength();
// printStereo();
printFrequency(frequency);
delay(50);
val = 0;
}
void initScreen()
{
/// tft.InitLCD();
// tft.setFont(BigNumbers);
tft.fillScreen(TFT_BLACK);
}
void showSplashScreen()
{
// tft.drawBitmap(0, 0, splash, 84, 48);
/// tft.update();
delay(3000);
tft.fillScreen(TFT_BLACK);
/// tft.update();
}
void printFrequency(float frequency)
{
String frequencyString = String(frequency,1);
if(frequencyString.length() == 4)
{
/// tft.setFont(BigNumbers);
tft.print(frequencyString);
// tft.update();
}
else
{
// tft.setFont(BigNumbers);
tft.print(frequencyString);
// tft.update();
}
}
ERROR:
Arduino: 1.8.19 (Windows 10), Board: "Arduino Uno"
text section exceeds available space in boardSketch uses 43662 bytes (135%) of program storage space. Maximum is 32256 bytes.
Global variables use 820 bytes (40%) of dynamic memory, leaving 1228 bytes for local variables. Maximum is 2048 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
Error compiling for board Arduino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.