Problem with uint8_t in header file

I'm using uint8_t in a header file, which caused all sorts of problems as it was not a recognized type.

See this thread (not mine, but applicable):

I've tried to add:
#include <Particle.h>
#include <application.h>
#include <types.h>

All to no avail. They all return an error of 'No such file or directory'

Here is the header file:

/*
    This class carries the data and methods that process each circuit
 */
#include <Particle.h>
// #include <application.h>
// #include <types.h>

#define byte uint8_t

class ArCircuit 
{
private:
    int _numReads;              // The number of successive reads currently being stored
        
    byte _adcNum;                // The ADC number this circuit is attached to
    byte _adcType;               // The type of ADC this is, such as MCP3208 or other
    byte _adcPin;                // The pin number on the ADC for this circuit
       
public:
    ArCircuit() {}
    ArCircuit(byte adcNumSet, byte adcTypeSet, byte adcPinSet);
    
    byte getADCNum() { return _adcNum; }
    void setADCNum(byte adcNumSet) { _adcNum = adcNumSet; }
    byte getADCType() { return _adcType; }
    void setADCType(byte adcTypeSet) { _adcType = adcTypeSet; }
    byte getADCPin() { return _adcPin; }
    void setADCPin(byte adcPinSet) { _adcPin = adcPinSet; }
};

Include Arduino.h is the simplest. Else you need to read up on typedef; the problem is that you might define it different from how the Arduino environment.

typedef unsigned char uint8_t;

The above is the line from C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include\stdint.h that defines uint8_t. This file is included via Arduino.h; so you can also include stdint.h instead of Arduino.h in your header file.

Quercus47:
(not mine, but applicable):
Error: 'uint8_t' does not name a type - Troubleshooting - Particle

I've tried to add:
#include <Particle.h>
#include <application.h>
#include <types.h>

All to no avail. They all return an error of 'No such file or directory'

Are you using this Particle thing? If not then it's not applicable.

sterretje:
Include Arduino.h is the simplest.

That worked! Thanks.

pert; no, I just saw that in the other thread I read and tried it. I guess no wonder it didn't work

Thanks.