canon_ble #82

Merged
mattmcw merged 149 commits from canon_ble into main 2023-08-01 03:38:52 +00:00
2 changed files with 28 additions and 26 deletions
Showing only changes of commit 1d6cbe5c53 - Show all commits
notes
esp32_serial
nano_softserial

View File

@ -2,21 +2,27 @@
#include <Arduino.h> #include <Arduino.h>
#define RXD2 16 #define RXD2 16
#define TXD2 -1 #define TXD2 17
#define LOG_LOCAL_LEVEL ESP_LOG_INFO
#include "esp_log.h"
#include <esp32-hal-log.h>
HardwareSerial Serial2(1); HardwareSerial Serial2(1);
volatile char cmd = 'z';
void setup () { void setup () {
Serial2.begin(57600, SERIAL_8N1, RXD2, TXD2); Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
} }
void loop () { void loop () {
now = millis();
if (Serial2.available() > 0) { if (Serial2.available() > 0) {
//cmdChar = Serial2.read(); cmd = Serial2.read();
}
if (cmd == 'x') {
Serial2.print('x');
} }
} }

View File

@ -1,19 +1,3 @@
/**
*
* Camera Remote Menu
*
*
*
*
*
* Camera Settings
*
*
*
*
*
**/
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
#define SOFTWARE_RX 10 #define SOFTWARE_RX 10
@ -21,14 +5,26 @@
SoftwareSerial softPort(SOFTWARE_RX, SOFTWARE_TX); SoftwareSerial softPort(SOFTWARE_RX, SOFTWARE_TX);
volatile char cmd = 'z';
volatile long now;
volatile long start;
void setup () { void setup () {
softPort.begin(57600); softPort.begin(9600);
start = millis();
pinMode(LED_BUILTIN, OUTPUT);
} }
void loop () { void loop () {
now = millis();
if (softPort.available() > 0) { if (softPort.available() > 0) {
//sChar = softPort.read(); cmd = softPort.read();
}
if (cmd == 'x') {
digitalWrite(LED_BUILTIN, HIGH);
}
if (now >= start + 5000) {
softPort.print('x');
} }
} }