1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Rename Terminal library to Shell library

This commit is contained in:
Rhys Weatherley
2016-03-13 07:24:22 +10:00
parent 4c51be9ae8
commit f5dc64aa7c
16 changed files with 8 additions and 8 deletions

View File

@@ -0,0 +1,35 @@
/*
This example demonstrates how to create a simple shell on the serial port.
This example is placed into the public domain.
*/
#include <Shell.h>
Shell shell;
int ledPin = 13;
void cmdLed(Shell &shell, int argc, const ShellArguments &argv)
{
if (argc > 1 && !strcmp(argv[1], "on"))
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}
ShellCommand(led, "Turns the status LED on or off", cmdLed);
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
shell.setPrompt("Command: ");
shell.begin(Serial, 5);
}
void loop()
{
shell.loop();
}