[SOLVED] "void logo() {" In function 'void setup()': clark:98:8: error: 'logo' was not declared in this scope

For some reason when I try to create a function to be called it gives me an error. Any suggestions?

#include "heltec.h"
#include "images.h"

#define BAND 915E6 //you can set band here directly,e.g. 868E6,915E6
#include <Adafruit_ADS1X15.h>

// Adafruit_ADS1115 ads; /* Use this for the 16-bit version /
Adafruit_ADS1015 ads; /
Use this for the 12-bit version */
unsigned int counter = 0;
String rssi = "RSSI --";
String packSize = "--";
String packet ;
int ledPin = 13

void logo()
{

Heltec.display->clear();
Heltec.display->drawXbm(0, 5, logo_width, logo_height, logo_bits);
Heltec.display->display();
}

void flash()
{
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
}

void packetSend()
{
Heltec.display->clear();

Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
Heltec.display->setFont(ArialMT_Plain_10);

Heltec.display->drawString(0, 0, "Sending packet: ");
Heltec.display->drawString(90, 0, String(counter));
Heltec.display->display();

// send packet
LoRa.beginPacket();

/*
LoRa.setTxPower(txPower,RFOUT_pin);
txPower -- 0 ~ 20
RFOUT_pin could be RF_PACONFIG_PASELECT_PABOOST or RF_PACONFIG_PASELECT_RFO
- RF_PACONFIG_PASELECT_PABOOST -- LoRa single output via PABOOST, maximum output 20dBm
- RF_PACONFIG_PASELECT_RFO -- LoRa single output via RFO_HF / RFO_LF, maximum output 14dBm
*/
LoRa.setTxPower(14, RF_PACONFIG_PASELECT_PABOOST);
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();

counter++;
digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

void setup(void)
{
Serial.begin(9600);
Serial.println("Hello!");

Serial.println("Single-ended readings from AIN0 with >3.0V comparator");
Serial.println("ADC Range: +/- 6.144V (1 bit = 3mV/ADS1015, 0.1875mV/ADS1115)");
Serial.println("Comparator Threshold: 1000 (3.000V)");

// The ADC input range (or gain) can be changed via the following
// functions, but be careful never to exceed VDD +0.3V max, or to
// exceed the upper and lower limits if you adjust the input range!
// Setting these values incorrectly may destroy your ADC!
// ADS1015 ADS1115
// ------- -------
// ads.setGain(GAIN_TWOTHIRDS); // 2/3x gain +/- 6.144V 1 bit = 3mV 0.1875mV (default)
// ads.setGain(GAIN_ONE); // 1x gain +/- 4.096V 1 bit = 2mV 0.125mV
// ads.setGain(GAIN_TWO); // 2x gain +/- 2.048V 1 bit = 1mV 0.0625mV
// ads.setGain(GAIN_FOUR); // 4x gain +/- 1.024V 1 bit = 0.5mV 0.03125mV
// ads.setGain(GAIN_EIGHT); // 8x gain +/- 0.512V 1 bit = 0.25mV 0.015625mV
// ads.setGain(GAIN_SIXTEEN); // 16x gain +/- 0.256V 1 bit = 0.125mV 0.0078125mV

if (!ads.begin()) {
Serial.println("Failed to initialize ADS.");
while (1);
}
// Setup 3V comparator on channel 0
ads.startComparator_SingleEnded(0, 1000);

//WIFI Kit series V1 not support Vext control
Heltec.begin(true /DisplayEnable Enable/, true /Heltec.Heltec.Heltec.LoRa Disable/, true /Serial Enable/, true /PABOOST Enable/, BAND /long BAND/);

Heltec.display->init();
Heltec.display->flipScreenVertically();
Heltec.display->setFont(ArialMT_Plain_10);
logo();
delay(1500);
Heltec.display->clear();

Heltec.display->drawString(0, 0, "Heltec.LoRa Initial success!");
Heltec.display->display();
delay(1000);
}

void loop()
{
int16_t adc0;

// Comparator will only de-assert after a read
adc0 = ads.getLastConversionResults();
Serial.print("AIN0: "); Serial.println(adc0);
if (adc0 > 0 ) {
flash();
packetSend();
} else if (adc0 < -1 ) {
flash();
packetSend();
}

delay(100);
}

You need a ; <———<<<<

1 Like

wow im dumb haha thanks, working just fine now.

@currydem23, your topic has been moved to a more suitable location on the forum as this has nothing to do with Avrdude, stk500 or Bootloader.

In future, please use code tags when posting code.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.