Index

auto-plow / 00e5d64

A wheelchair motor-propelled battery-powered ESP32-driven remote control snow plow.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
2902 Dec 2018 05:5500e5d64New method for resetting Arduinojoshuas3120N

Blob @ auto-plow / src / ard1 / ard1.cpp

text/plain617 bytesdownload raw
1#include "Arduino.h"
2#include "ard1.h"
3#include "reset.h"
4
5// One time
6void setup() {
7 digitalWrite(PIN_RESET, HIGH);
8 pinMode(PIN, OUTPUT);
9 digitalWrite(PIN, ON);
10 Serial.begin(BAUD_RATE);
11 while (!Serial)
12 ;
13 Serial.println("ARD1: Motor Controller Active");
14}
15
16// Repeatedly
17void loop() {
18 if (Serial.available() > 0) {
19 Serial.print("ARD1: Received information - ");
20 String message = Serial.readStringUntil(';');
21 Serial.println(message);
22 Serial.flush();
23 if (message == String("Restart")) {
24 Serial.println("ARD1: Restarting...");
25 Serial.flush();
26 reset();
27 }
28 }
29}
30