Bonjour,
J'ai le message d'erreur suivant quand j'utilise ma library :
" error: request for member 'setLed' in 'command', which is of non-class type 'Command ()()' "
Utilisation :
#include <Command.h>
Command command();
...
response = command.setLed(val1, val2);
...
Mes fichiers :
Command.h
/*
Command.h
*/
#ifndef Command_h
#define Command_h
#include "Arduino.h"
class Command
{
public:
Command();
boolean setLed(char *pinLed, char *stat);
};
#endif
Command.cpp
/*
Command.cpp
*/
#include "Arduino.h"
#include "Command.h"
Command::Command()
{
}
// Allumer ou éteindre une LED
boolean Command::setLed(char *pinLed, char *stat)
{
// Convert property to int
int pin = atoi(pinLed);
// Convert period to int
int val = atoi(stat);
if(val>0){
digitalWrite(pin, HIGH);
}else{
digitalWrite(pin, LOW);
}
return true;
}