Move mcopy serial script. Add work (isn't working).
This commit is contained in:
parent
346c303edb
commit
95e2e997e5
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
cp McopySerial.* ../../mcopy_cam_canon/
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue