Skip to content

Instantly share code, notes, and snippets.

@nanzono
Created August 31, 2014 16:40
Show Gist options
  • Save nanzono/3b367d1e104812ad8f6d to your computer and use it in GitHub Desktop.
Save nanzono/3b367d1e104812ad8f6d to your computer and use it in GitHub Desktop.
Arduino側からOpenWRTを呼び出して操作するために
#include <Process.h>
void c_print(Process p){
while(p.available()>0){
char c = p.read();
Serial.print(c);
}
Serial.flush();
}
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
delay(2000);
digitalWrite(13, LOW);
Bridge.begin();
Serial.begin(9600);
while (!Serial);
Process p;
//p.begin("dhclient");
//p.addParameter("-r");
//p.run();
//p.begin("cat");
//p.addParameter("/etc/config/network");
//p.run();
// p.begin("ifconfig");
// p.run();
p.begin("ls");
p.addParameter("-l");
p.addParameter("/mnt/sda1/");
p.run();
c_print(p);
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment