Index

auto-plow / 375f09b

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
3905 Dec 2018 19:36375f09bUpdate ard1.cppjoshuas311811N

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

text/plain851 bytesdownload raw
1#include "Arduino.h"
2#include "ard1.h"
3#include "serial.h"
4#include "reset.h"
5
6
7void oninput(String message);
8
9// One time
10void setup() {
11 digitalWrite(PIN_RESET, HIGH);
12 serial();
13 Serial.println("ARD1: Motor Controller Active");
14 Serial.print("ARD1: Setting PIN ");
15 Serial.print(PIN);
16 Serial.println("'s mode to OUTPUT");
17 pinMode(PIN, OUTPUT);
18 Serial.print("ARD1: Turning PIN ");
19 Serial.print(PIN);
20 Serial.println(" ON");
21 digitalWrite(PIN, ON);
22 input(oninput);
23 Serial.println(sizeof(&input));
24 Serial.println(sizeof(callback));
25}
26
27void oninput (String message) {
28 Serial.print("ARD1: Received information - ");
29 Serial.println(message);
30 Serial.flush();
31 if (message == String("Restart")) {
32 Serial.println("ARD1: Restarting...");
33 Serial.flush();
34 reset();
35 }
36}
37
38// Repeatedly
39void loop() {
40 input_update();
41}
42