Skip to content

Instantly share code, notes, and snippets.

@biskandar
Created October 8, 2012 11:48
Show Gist options
  • Save biskandar/3852096 to your computer and use it in GitHub Desktop.
Save biskandar/3852096 to your computer and use it in GitHub Desktop.
Simplified webserver module using Webduino library 2012100802
#include "SPI.h"
#include "Ethernet.h"
#include "WebServer.h"
#include "aJSON.h"
// prepare for the ethernet profile
static uint8_t mac[] = { 0x00 , 0x08, 0xDC, 0x00, 0x00, 0x09 } ;
static uint8_t ip[] = { 169, 254, 62, 169 } ;
// prepare for webserver with webduino
WebServer webserver( "" , 80 ) ;
void setup() {
// debug purpose
Serial.begin( 9600 ) ;
Serial.println( "Debug on" ) ;
// initialized for the ethernet connection
Ethernet.begin( mac , ip ) ;
// setup default command request of the webserver
webserver.setDefaultCommand( &defaultCommand ) ;
// start the server
webserver.begin() ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment