canon_ble #82
|
@ -58,7 +58,7 @@ const char cmd_debug = 'd';
|
||||||
const char cmd_connect = 'i';
|
const char cmd_connect = 'i';
|
||||||
volatile char cmd_char = 'z';
|
volatile char cmd_char = 'z';
|
||||||
const char cmd_mcopy_identifier = 'm';
|
const char cmd_mcopy_identifier = 'm';
|
||||||
const char cmd_proj_identifier = 't'; //dual projector identifier
|
const char cmd_proj_identifier = 'd'; //dual projector identifier
|
||||||
|
|
||||||
const int serialDelay = 5;
|
const int serialDelay = 5;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
env
|
File diff suppressed because it is too large
Load Diff
|
@ -5,20 +5,21 @@ import serial.tools.list_ports
|
||||||
ports = serial.tools.list_ports.comports()
|
ports = serial.tools.list_ports.comports()
|
||||||
port = ''
|
port = ''
|
||||||
for p in ports:
|
for p in ports:
|
||||||
print p
|
print(p)
|
||||||
if "Arduino" in p.description:
|
if "Arduino" in p.description or 'ACM0' in p.description:
|
||||||
print "This is an Arduino!"
|
print("This is an Arduino!")
|
||||||
port = p.device
|
port = p.device
|
||||||
break
|
break
|
||||||
|
|
||||||
if p is '':
|
if port == '':
|
||||||
print("Arduino is not connected")
|
print("Arduino is not connected")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
arduino = serial.Serial(port=port, baudrate=57600, timeout=.05)
|
arduino = serial.Serial(port=port, baudrate=57600, timeout=.05)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
while arduino.in_waiting: # Or: while ser.inWaiting():
|
with open('debug.csv', 'w') as file:
|
||||||
print arduino.readline()
|
while True: # Or: while ser.inWaiting():
|
||||||
|
file.write(arduino.readline().decode())
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,12 @@ const int PROJECTOR_BWD = 4;
|
||||||
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
const int PROJECTOR_MICROSWITCH_CLOSED = 0;
|
||||||
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
const int PROJECTOR_MICROSWITCH_OPENED = 1;
|
||||||
|
|
||||||
|
volatile long now;
|
||||||
volatile long startTime = 0;
|
volatile long startTime = 0;
|
||||||
volatile boolean writing = false;
|
volatile boolean writing = false;
|
||||||
|
|
||||||
void setup () {
|
void setup () {
|
||||||
|
Serial.begin(57600);
|
||||||
pins();
|
pins();
|
||||||
startTime = millis();
|
startTime = millis();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue