Move mcopy serial script. Add work (isn't working).

This commit is contained in:
Matt McWilliams 2023-03-08 21:28:09 -05:00
parent 346c303edb
commit 95e2e997e5
5 changed files with 36 additions and 3 deletions

View File

@ -1,13 +1,27 @@
/// mcopy Serial Library
#include "McopySerial.h"
McopySerial::McopySerial () {
}
void McopySerial::on()
void McopySerial::begin () {
Serial.begin(baud);
}
void McopySerial::loop () {
if (Serial.available()) {
cmdChar = (char) Serial.read();
}
if (cmdChar != 'z') {
//cmd(cmdChar);
cmdChar = 'z';
}
}
void McopySerial::setBaud (int baudRate) {
baud = baudRate;
}

View File

@ -3,17 +3,21 @@
#include "Arduino.h"
typedef void (*mcopy_callback)(void);
class McopySerial {
private:
volatile int baud = 57600;
volatile bool debugOn = false;
volatile char cmdChar = 'z';
public:
McopySerial();
void begin();
void setBaud(int baudRate);
void loop();
void debug (bool state);
void log (String message);

View File

@ -1,3 +0,0 @@
#!/bin/bash
cp McopySerial.* ../../mcopy_cam_canon/

View File

@ -1,13 +1,27 @@
/// mcopy Serial Library
#include "McopySerial.h"
McopySerial::McopySerial () {
}
void McopySerial::on()
void McopySerial::begin () {
Serial.begin(baud);
}
void McopySerial::loop () {
if (Serial.available()) {
cmdChar = (char) Serial.read();
}
if (cmdChar != 'z') {
//cmd(cmdChar);
cmdChar = 'z';
}
}
void McopySerial::setBaud (int baudRate) {
baud = baudRate;
}

View File

@ -3,17 +3,21 @@
#include "Arduino.h"
typedef void (*mcopy_callback)(void);
class McopySerial {
private:
volatile int baud = 57600;
volatile bool debugOn = false;
volatile char cmdChar = 'z';
public:
McopySerial();
void begin();
void setBaud(int baudRate);
void loop();
void debug (bool state);
void log (String message);