canon_ble #82

Merged
mattmcw merged 149 commits from canon_ble into main 2023-08-01 03:38:52 +00:00
7 changed files with 38 additions and 49 deletions
Showing only changes of commit 5c6b9191e5 - Show all commits

View File

@ -2,7 +2,7 @@
#include "McopySerial.h" #include "McopySerial.h"
McopySerial::McopySerial (char identity) { McopySerial::McopySerial ( char identity) {
id = identity; id = identity;
} }

View File

@ -2,7 +2,7 @@
#include "McopySerial.h" #include "McopySerial.h"
McopySerial::McopySerial (char identity) { McopySerial::McopySerial ( char identity) {
id = identity; id = identity;
} }

View File

@ -2,7 +2,7 @@
#include "McopySerial.h" #include "McopySerial.h"
McopySerial::McopySerial (char identity) { McopySerial::McopySerial ( char identity) {
id = identity; id = identity;
} }

View File

@ -65,6 +65,8 @@ McopySerial mc(McopySerial::PROJECTOR_IDENTIFIER);
void setup () { void setup () {
mc.begin(); mc.begin();
pins(); pins();
proj_dir = false;
cmdChar = 'p';
} }
void loop () { void loop () {
@ -73,7 +75,7 @@ void loop () {
if (proj_running) { if (proj_running) {
proj_microswitch(); proj_microswitch();
} else { } else {
cmdChar = mc.loop(); //cmdChar = mc.loop();
cmd(cmdChar); cmd(cmdChar);
} }
} }
@ -83,8 +85,8 @@ void pins () {
pinMode(PROJECTOR_FWD, OUTPUT); pinMode(PROJECTOR_FWD, OUTPUT);
pinMode(PROJECTOR_BWD, OUTPUT); pinMode(PROJECTOR_BWD, OUTPUT);
digitalWrite(PROJECTOR_FWD, LOW); digitalWrite(PROJECTOR_FWD, HIGH);
digitalWrite(PROJECTOR_BWD, LOW); digitalWrite(PROJECTOR_BWD, HIGH);
} }
void cmd (char val) { void cmd (char val) {
@ -103,9 +105,9 @@ void proj_start () {
proj_time = millis(); proj_time = millis();
if (proj_dir) { if (proj_dir) {
digitalWrite(PROJECTOR_FWD, HIGH); digitalWrite(PROJECTOR_FWD, LOW);
} else { } else {
digitalWrite(PROJECTOR_BWD, HIGH); digitalWrite(PROJECTOR_BWD, LOW);
} }
proj_running = true; proj_running = true;
@ -114,8 +116,8 @@ void proj_start () {
void proj_stop () { void proj_stop () {
//stop both directions //stop both directions
delay(10); delay(10);
digitalWrite(PROJECTOR_FWD, LOW); digitalWrite(PROJECTOR_FWD, HIGH);
digitalWrite(PROJECTOR_BWD, LOW); digitalWrite(PROJECTOR_BWD, HIGH);
mc.confirm(McopySerial::PROJECTOR); mc.confirm(McopySerial::PROJECTOR);
mc.log("projector()"); mc.log("projector()");

View File

@ -2,7 +2,7 @@
#include "McopySerial.h" #include "McopySerial.h"
McopySerial::McopySerial (char identity) { McopySerial::McopySerial ( char identity) {
id = identity; id = identity;
} }

View File

@ -1,34 +0,0 @@
/*
JK modules
Directional switch connector =
Philmore
Mobile Connector
Panel Mount 3 Pin Male/Female
No. 61-623
.625" Diameter
*/
module jk_male_connector_mount () {
$fn = 200;
D = 17;
OD = 28;
H = 25;
difference () {
union () {
cylinder(r = OD / 2, h = H, center = true);
//cube([12, 48, 3], center = true);
}
//main void
translate([0, 0, -3]) cylinder(r = (OD / 2) - 3, h = H, center = true);
//connector void
cylinder(r = D / 2, h = H * 2, center = true);
}
}
rotate([180, 0, 0]) jk_male_connector_mount();

21
scad/mcopy_projector.scad Normal file
View File

@ -0,0 +1,21 @@
include <./common/common.scad>;
PART = "debug";
module debug () {
cube();
}
module projector () {
}
module key () {
}
if (PART == "projector") {
} else {
debug();
}