Skip to content

Commit 248317c

Browse files
committed
update pinout
1 parent 92e75f3 commit 248317c

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

code/controller/src/main.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ HardwareSerial mySerial(1);
1919
WebServer server(80);
2020

2121
// defines pins
22-
#define STEP_PIN 13
23-
#define DIR_PIN 12
22+
#define STEP_PIN 16
23+
#define DIR_PIN 17
2424
#define HALL_PIN 15
2525

2626
SplitFlap splitFlap(STEP_PIN, DIR_PIN, HALL_PIN);
@@ -73,11 +73,6 @@ bool handleFileRead(String path)
7373
return false;
7474
}
7575

76-
void handleRoot()
77-
{
78-
server.send(200, "text/html", "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"></head><body><h1>Hey there!</h1></body></html>");
79-
}
80-
8176
void handleNotFound()
8277
{
8378
if (!handleFileRead(server.uri()))
@@ -198,6 +193,7 @@ void setup()
198193
}
199194

200195
splitFlap.init();
196+
splitFlap.home();
201197

202198
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
203199
Serial.println("Establishing connection to WiFi");
@@ -221,7 +217,6 @@ void setup()
221217
}
222218
Serial.println("mDNS responder started");
223219

224-
// server.on("/", handleRoot);
225220
// server.on("/character", handleCharacter);
226221
server.on("/api/splitflap", handleSplitflap);
227222
server.on("/flaps", handleFlaps);
@@ -233,7 +228,6 @@ void setup()
233228

234229
void loop()
235230
{
236-
server.handleClient();
237-
238231
splitFlap.update();
232+
server.handleClient();
239233
}

code/module/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#define RXD1 21
88

99
// defines pins
10-
#define STEP_PIN 22
11-
#define DIR_PIN 23
10+
#define STEP_PIN 16
11+
#define DIR_PIN 17
1212
#define HALL_PIN 15
1313

1414
SplitFlap splitFlap(STEP_PIN, DIR_PIN, HALL_PIN);

code/shared/include/SplitFlap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class SplitFlap
3030
pinMode(dirPin, OUTPUT);
3131
pinMode(hallPin, INPUT_PULLUP);
3232

33-
digitalWrite(dirPin, HIGH); // Enables the motor to move in a particular direction
33+
digitalWrite(dirPin, LOW); // Enables the motor to move in a particular direction
3434
}
3535

3636
void home()

0 commit comments

Comments
 (0)