Update McopySerial usage in both scripts that use it.
This commit is contained in:
parent
4e0149e752
commit
231c354cb1
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
SoftwareSerial pixieSerial(-1, PIXIEPIN);
|
SoftwareSerial pixieSerial(-1, PIXIEPIN);
|
||||||
Adafruit_Pixie light = Adafruit_Pixie(NUMPIXELS, &pixieSerial);
|
Adafruit_Pixie light = Adafruit_Pixie(NUMPIXELS, &pixieSerial);
|
||||||
McopySerial mc(McopySerial::LIGHT_IDENTIFIER);
|
McopySerial mc;
|
||||||
|
|
||||||
String color = "000,000,000";
|
String color = "000,000,000";
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ volatile char cmd = 'z';
|
||||||
|
|
||||||
|
|
||||||
void setup () {
|
void setup () {
|
||||||
mc.begin();
|
mc.begin(mc.LIGHT_IDENTIFIER);
|
||||||
pixieSerial.begin(115200); // Pixie REQUIRES this baud rate
|
pixieSerial.begin(115200); // Pixie REQUIRES this baud rate
|
||||||
light.setPixelColor(0, 0, 0, 0);
|
light.setPixelColor(0, 0, 0, 0);
|
||||||
light.show();
|
light.show();
|
||||||
|
@ -41,10 +41,10 @@ void loop () {
|
||||||
now = millis();
|
now = millis();
|
||||||
cmd = mc.loop();
|
cmd = mc.loop();
|
||||||
|
|
||||||
if (cmd == McopySerial::LIGHT) {
|
if (cmd == mc.LIGHT) {
|
||||||
color = mc.getString();
|
color = mc.getString();
|
||||||
parseColorString();
|
parseColorString();
|
||||||
mc.confirm(McopySerial::LIGHT);
|
mc.confirm(mc.LIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//send light signal to pixie every second
|
//send light signal to pixie every second
|
||||||
|
|
|
@ -33,7 +33,7 @@ volatile bool ledState;
|
||||||
const String name_remote = "mcopy";
|
const String name_remote = "mcopy";
|
||||||
CanonBLERemote canon_ble(name_remote);
|
CanonBLERemote canon_ble(name_remote);
|
||||||
TickTwo blinker(blink, 500);
|
TickTwo blinker(blink, 500);
|
||||||
McopySerial mc(McopySerial::CAMERA_IDENTIFIER);
|
McopySerial mc;
|
||||||
|
|
||||||
volatile boolean connected = false;
|
volatile boolean connected = false;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ void loop()
|
||||||
now = millis();
|
now = millis();
|
||||||
cmd = mc.loop();
|
cmd = mc.loop();
|
||||||
|
|
||||||
if (cmd == McopySerial::CAMERA && last + 1000 < now) {
|
if (cmd == mc.CAMERA && last + 1000 < now) {
|
||||||
shutter();
|
shutter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,5 +114,5 @@ void shutter () {
|
||||||
blinker.pause();
|
blinker.pause();
|
||||||
digitalWrite(LED, HIGH);
|
digitalWrite(LED, HIGH);
|
||||||
last = millis();
|
last = millis();
|
||||||
mc.confirm(McopySerial::CAMERA);
|
mc.confirm(mc.CAMERA);
|
||||||
}
|
}
|
Loading…
Reference in New Issue