An error occurred when i tried to upload the file into arduino atmega2560. Below is one of the library files where the error is highlighted at.
The error says:
herkulex.h:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'herkulex'
herkulex.c:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
herkulex.c:166: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
herkulex.c:172: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
herkulex.c:194: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
herkulex.c:285: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
And the 'class' word in this file is highlighted.
May I know what's wrong with this code? Thanks!
code:
#ifndef herkulex_lib
#define herkulex_lib
#include <Arduino.h>
#include <Wire.h>
#include<inttypes.h>
class herkulex
{
public:
herkulex();
void hklx_Init(unsigned long ulBaudRate);
void hklx_SendPacket(DrsPacket stPacket);
unsigned char hklx_ucReceivePacket(DrsPacket *pstPacket);
void hklx_RemoveInvalidData(void);
//no private
};
#endif /* HERKULEX_H_ */
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.