Here's a pair of functions that I set up as a test, it's in HitCounter.h which is in the same directory of the main sketch.
When I open the main sketch, the HitCounter file is also opened at the same time, in another tab, but when I compile, I get an error: "Function definition does not declare parameters" Neither function takes a passed parameter, or returns one, so I don't understand the error message.
In the main sketch, I get an error saying that "HitCounter was not declared in this scope"
char Hits = 0;
void HitCounter{
Hits++;
}
long Uptime = 0;
long LastUpTime = 0;
void Update_Uptime(){
if (millis() - LastUpTime < 1000){return;}
Uptime++;
LastUpTime = millis();
}
In the main application, I have this:
#include <SPI.h>
#include <Ethernet.h>
#include <OneWire.h>
#include "HitCounter.h"
(other things that are irrelevant)
// Glorious main loop with nothing in it.
void loop(){
//pinMode(3,OUTPUT);
//digitalWrite(3,HIGH);
Update_Uptime(); // One function I'm trying to use
web();
//digitalWrite(3,LOW);
DS_Temp();
}
// Handles serving up pages if someone is connected
void web(){
// listen for incoming clients
EthernetClient client = server.available();
if (client) {
HitCounter(); // The other one I'm trying to use.
(more code not relevant to the issue)
}