Index

auto-plow / 93a17bd

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
2601 Dec 2018 22:37ab6d622Move some Arduino variables to their own header fileJoshua1710N

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

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