Help with Sketch Error

Hello! Would someone be willing to help with the error in this code? Specifically const uint64_t pipe = 0xE8E8F0F0E1LL; Thanks so much!

#include <Pushbutton.h>

#include <SimpleTimer.h>

//Transmitter coding for the nrf24L01 radio transceiver.
//NRF24L01 and Arduino based Wireless Industrial Temperature Monitoring System

//https://www.electroniclinic.com/
/*
pins connections

vcc 3.3
gnd gnd
ce pin9
scn pin10
sck pin13
mosi pin11
moso pin12

*/


#include <Adafruit_MLX90614.h>
#include <SimpleTimer.h>
#include <SPI.h>
 #include <nRF24L01.h>
 #include <RF24.h>
 #define CE_PIN 9
 #define CSN_PIN 10

Adafruit_MLX90614 mlx = Adafruit_MLX90614();
 
double temp_amb;
double temp_obj; 
void setup()

#define Pushbutton 2 
const uint64_t pipe = 0xE8E8F0F0E1LL;

RF24 radio(CE_PIN, CSN_PIN);
byte data[6]; // depending on the number of sensors used

SimpleTimer timer;

void setup()
 {
 Serial.begin(9600);
 radio.begin();
 radio.openWritingPipe(pipe);

 timer.setInterval(1000L, tempdata);

 }

void loop()
 {
 timer.run();

radio.write( data, sizeof(data) );
Serial.println(data[0]);


}

void tempdata()
{

temp_amb = mlx.readAmbientTempF();
  temp_obj = mlx.readObjectTempF();

}void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Please post the full error message by copying it using the "Copy error message" button in the IDE

1 Like

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Uno"

transmitter_sample_wireless_temp:38:7: error: expected initializer before 'uint64_t'

const uint64_t pipe = 0xE8E8F0F0E1LL;

   ^~~~~~~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino: In function 'void setup()':

transmitter_sample_wireless_temp:49:24: error: 'pipe' was not declared in this scope

radio.openWritingPipe(pipe);

                    ^~~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino:49:24: note: suggested alternative: 'Wire'

radio.openWritingPipe(pipe);

                    ^~~~

                    Wire

transmitter_sample_wireless_temp:51:35: error: no matching function for call to 'SimpleTimer::setInterval(long int, void (&)())'

timer.setInterval(1000L, tempdata);

                               ^

In file included from C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino:3:0:

C:\Users\splwgn\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:23:10: note: candidate: void SimpleTimer::setInterval(uint64_t)

 void setInterval(uint64_t interval);

      ^~~~~~~~~~~

C:\Users\splwgn\Documents\Arduino\libraries\SimpleTimer/SimpleTimer.h:23:10: note: candidate expects 1 argument, 2 provided

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino: In function 'void loop()':

transmitter_sample_wireless_temp:57:8: error: 'class SimpleTimer' has no member named 'run'

timer.run();

    ^~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino: In function 'void setup()':

transmitter_sample_wireless_temp:71:7: error: redefinition of 'void setup()'

}void setup() {

   ^~~~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino:45:6: note: 'void setup()' previously defined here

void setup()

  ^~~~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino: In function 'void loop()':

transmitter_sample_wireless_temp:76:6: error: redefinition of 'void loop()'

void loop() {

  ^~~~

C:\Users\splwgn\Documents\Arduino\transmitter_sample_wireless_temp\transmitter_sample_wireless_temp.ino:55:6: note: 'void loop()' previously defined here

void loop()

  ^~~~

exit status 1

expected initializer before 'uint64_t'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Thank you for clarification!

void setup()

What does that line of code do ?

I'm not quite sure. That is what I'm trying to determine in the sequence. Let me do so more research, you are right, there is nothing there to commence.

Start a new sketch in the IDE and look at its structure and you will see that it is nothing like yours

1 Like

Deleted that command "void setup()". Not sure how it ended up there. Thank you

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