Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Besoin d'aide #10

Closed
ludodoucet opened this issue Jul 10, 2017 · 1 comment
Closed

Besoin d'aide #10

ludodoucet opened this issue Jul 10, 2017 · 1 comment

Comments

@ludodoucet
Copy link

ludodoucet commented Jul 10, 2017

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() {
shutters.loop();
} sketch_jul10b:6: error: too many initializers for 'const char []'

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?

@ludodoucet
Copy link
Author

Je ferme car je suis largé...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant