Hi!
I'm making a class for controlling brushless DC motors. I got a large 'pwmSin' array, and want to store this array in the header file:
#include "Arduino.h"
#ifndef BLDC_h
#define BLDC_h
class BLDC
{
public:
BLDC(uint8_t phase1, uint8_t phase2, uint8_t phase3);
void step(bool direction);
private:
uint8_t _phase1;
uint8_t _phase2;
uint8_t _phase3;
const byte pwmSin[48] = {127,110,94,78,64,50,37,26,17,10,4,1,0,1,4,10,17,26,37,50,64,78,94,110,127,144,160,176,191,204,217,228,237,244,250,253,254,253,250,244,237,228,217,204,191,176,160,144,127 };
};
#endif
Still I get this error message:
In file included from BLDC.cpp:1:0:
BLDC.h:23: error: too many initializers for 'const uint8_t [48] {aka const unsigned char [48]}'
const uint8_t pwmSin[48] = {127,110,94,78,64,50,37,26,17,10,4,1,0,1,4,10,17,26,37,50,64,78,94,110,127,144,160,176,191,204,217,228,237,244,250,253,254,253,250,244,237,228,217,204,191,176,160,144,127};
^
too many initializers for 'const uint8_t [48] {aka const unsigned char [48]}'
How can I store a byte array in the header, and access it in the cpp file?