Index

auto-plow / 2b15547

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
329 Nov 2018 21:038e1c1c4Create main.cJoshua1250N

Blob @ auto-plow / src / rpi / main.c

text/plain685 bytesdownload raw
1#include "stdio.h"
2
3int main() {
4 printf("");
5 printf("AutoPlow starting...\n\n");
6
7 printf("Attempting to begin serial data read on ARD1 (Motor Controller) at /dev/ttyACM0\n");
8 FILE * ttyACM0;
9 ttyACM0 = fopen("/dev/ttyACM0", "r");
10 if (ttyACM0) {
11 printf("Successfully opened serial stream\n\n");
12 printf("Dumping contents:\n");
13 char buffer[4096];
14 while (fgets(buffer, sizeof(buffer), ttyACM0) != NULL) {
15 printf("Input: ");
16 printf(buffer);
17 }
18 printf("Closing file stream\n");
19 fclose(ttyACM0);
20 } else {
21 printf("Unsuccessful in opening serial stream. Make sure the Arduino is plugged in to the RPI.\n");
22 return 1;
23 }
24 return 0;
25}
26