You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Je me retrouve confronté à un problème de débutant, j'ai besoin de commander plusieurs volets avec mon arduino, pour ça j'ai besoin d'ajouter une fonction, je nage...peut être plus compréhensible avec ça:
Salut,
Je me retrouve confronté à un problème de débutant, j'ai besoin de commander plusieurs volets avec mon arduino, pour ça j'ai besoin d'ajouter une fonction, je nage...peut être plus compréhensible avec ça:
`#include <Shutters.h>
const unsigned long courseTime = 30 * 1000;
const float calibrationRatio = 0.1;
const char Volet[] = {"shutters", "shutters2"};
void shuttersUp() {
Serial.println("Shutters going up.");
// TODO: Implement the code for the shutters to go up
}
void shuttersDown() {
Serial.println("Shutter1 going down.");
// TODO: Implement the code for the shutters to go down
}
void shuttersHalt() {
Serial.println("Shutters halted.");
// TODO: Implement the code for the shutters to halt
}
uint8_t shuttersGetState() {
return 255;
}
void shuttersSetState(uint8_t state) {
Serial.print("Saving state ");
Serial.print(state);
Serial.println(".");
}
void onShuttersLevelReached(uint8_t level) {
Serial.print("Shutters at ");
Serial.print(level);
Serial.println("%");
}
Shutters shutters(courseTime, shuttersUp, shuttersDown, shuttersHalt, shuttersGetState, shuttersSetState, calibrationRatio, onShuttersLevelReached);
void setup() {
Serial.begin(9600);
shutters.begin();
Volet[1].setLevel(50); // Go to 50%
}
void loop() {
sketch_jul10b:6: error: too many initializers for 'const char []'
shutters.loop();
}
const char Volet[] = {"shutters", "shutters2"};
C:\Users\ludo\Documents\Arduino\sketch_jul10b\sketch_jul10b.ino: In function 'void setup()':
sketch_jul10b:45: error: request for member 'setLevel' in 'Volet[1]', which is of non-class type 'const char'
Volet[1].setLevel(50); // Go to 50%
exit status 1
too many initializers for 'const char []'
`
Pouvez vous m'aider?
The text was updated successfully, but these errors were encountered: