Go Down

Topic: Telnet Led Control (Read 804 times) previous topic - next topic


May 26, 2013, 04:43 am Last Edit: May 26, 2013, 07:27 am by JakeDuino Reason: 1
Simple Telnet Client Led Control

//Telnet Led Contol

// Etherned and SPI
#include <SPI.h>
#include <Ethernet.h>

// I am using an green led for this project , you can obviously change this
int greenled   = 9;

// MAC is software-set.
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0xE3, 0x5B };

// set your own network information as follows
IPAddress ip(129,173,97,17);
IPAddress gateway(129,173,96,1);
IPAddress subnet(255, 255, 254, 0);

EthernetServer telnetServer = EthernetServer(23);

void setup() {
 pinMode(greenled, OUTPUT);
 Serial.print("System Start");
 Ethernet.begin(mac, ip, gateway, subnet);

 Serial.print("Started the Servers\n");

void loop() {
 EthernetClient telnetClient = telnetServer.available();

 if (telnetClient) {
   boolean updatedState = false;
   char telnetValue = telnetClient.read();
   switch (telnetValue) {
     case '0':
       updatedState = true;
       digitalWrite (greenled, LOW);
     case '1':
       updatedState = true;
       digitalWrite(greenled, HIGH);


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131