Control 8 Leds with Arduino Please !

Hi
I Would Like to control arduino with 8 led’s ( D2 to D9 ) with a simple page.
I find this but doesn’t work : http://www.instructables.com/id/Ethernet-Shield-LED-WEB-SERVER/step4/The-program/

Error :

leds.cpp:1:79: error: LED.h: No such file or directory ( where is LED.h to download ? )
leds:4: error: missing terminating " character
leds:5: error: missing terminating " character
leds:5: error: expected primary-expression before ‘<’ token
leds:5: error: ‘form’ was not declared in this scope
leds:5: error: expected ‘,’ or ‘;’ before ‘method’
leds:17: error: expected primary-expression before ‘}’ token
leds:17: error: expected ‘,’ or ‘;’ before ‘}’ token
leds:17: error: expected declaration before ‘}’ token

I use Arduino Uno + Ethernet Shield ( with MiniSD ) + Arduino 0022

Regwards
Nuno Rodrigues
Lisbon
Portugal

Hey, I'm quite new to the Arduino and the Ethernet shield but I managed to find you the link where you can download the LED.h library. they have instructions on how to put the library in and there is a sample code for you to try out. I don't know if this is going to fix your problem but at least you have the library. :) (http://www.arduino.cc/playground/Code/LED)

Hi thanks …

so i have some problems … when compile :

sketch_mar26a.cpp:1:17: error: LED.h: No such file or directory
sketch_mar26a:46: error: ‘LED’ does not name a type
sketch_mar26a:47: error: ‘LED’ does not name a type
sketch_mar26a:48: error: ‘LED’ does not name a type
sketch_mar26a:49: error: ‘LED’ does not name a type
sketch_mar26a.cpp: In function ‘void loop()’:
sketch_mar26a:84: error: ‘class String’ has no member named ‘append’
sketch_mar26a:89: error: ‘class String’ has no member named ‘contains’
sketch_mar26a:91: error: ‘led1’ was not declared in this scope
sketch_mar26a:97: error: ‘class String’ has no member named ‘contains’
sketch_mar26a:99: error: ‘led2’ was not declared in this scope
sketch_mar26a:105: error: ‘class String’ has no member named ‘contains’
sketch_mar26a:107: error: ‘led3’ was not declared in this scope
sketch_mar26a:113: error: ‘class String’ has no member named ‘contains’
sketch_mar26a:115: error: ‘led4’ was not declared in this scope
sketch_mar26a:122: error: ‘class String’ has no member named ‘contains’
sketch_mar26a:124: error: cannot convert ‘String’ to ‘char*’ for argument ‘1’ to ‘char* strcpy(char*, const char*)’

can you help me ?

i will see the examples

Have you downloaded and installed the LED library linked earlier?

Yes I download "Led" to libary and i test the example "Blink".

Its Ok

But my question is : I would like to create a simple page with "ON/OFF" or same button to control 1 LED with Ethernet Shiled and webserver

I find some in google : but doesnt work

Can you help me !

but doesnt work

It doesn't compile? It doesn't download? It doesn't do what you want it to do?

What does it do, and how does that differ from what you want it to do?

for example : i find this : http://www.nuelectronics.com/estore/index.php?main_page=project_eth

( ethershield_web_switch.pde -- New -- Webserver example, switch on/off LED )

when compile , is ok When upload to Arduino , is ok

When go to webrowser , i havent conection ( and i havent ping on cmd )

i download the libary and add on software .....

Who can Help Me ? please

Are you able to do anything with any of the Ethernet shield examples?

Im a newbie, i would like to see a example turn on / turn off led with webserver with arduino, with a simple wepage..

Are you able to do anything with any of the Ethernet shield examples?

i.e. have you tried any of the provided examples to show that your ethernet shield works on your network?

Im Sorry im newbie in arduino (codes), but i see the examples off ethernet Shield and work "Only on program Arduino 0022"

i have this example , the code "Arduino" is modified with my friend. i create a simple webpage "on my server" (http://ptxserver.net/demo/)

but i would like to create a simple webpage embebed in arduino to control , "Without the webpage of example"

i see this but the code doesnt work :astonished: http://www.instructables.com/id/Ethernet-Shield-LED-WEB-SERVER/

im sorry im newbie

i see this but the code doesnt work

You're going to have to tell us what about it doesn't work. By "working" you have in your mind some observable sequence of events, so you need to tell us how what you actually observe differs from that.

ok on this website , i copied the code to "Arduino 0022" when i launch the button ( compile ) appears this :

( http://www.instructables.com/id/Ethernet-Shield-LED-WEB-SERVER/step4/The-program/ )

sketch_mar27b.cpp: In function 'void loop()': sketch_mar27b:83: error: 'class String' has no member named 'append' sketch_mar27b:88: error: 'class String' has no member named 'contains' sketch_mar27b:96: error: 'class String' has no member named 'contains' sketch_mar27b:104: error: 'class String' has no member named 'contains' sketch_mar27b:112: error: 'class String' has no member named 'contains' sketch_mar27b:121: error: 'class String' has no member named 'contains' sketch_mar27b:123: error: cannot convert 'String' to 'char*' for argument '1' to 'char* strcpy(char*, const char*)'

another more easy...

I have this Libary ( http://www.nuelectronics.com/estore/index.php?main_page=project_eth ) I Selected ( ethershield_web_switch.pde ) when copile and upload to board its ok.

But i havent acess or ping ( ethernet ) ???

OK, so we still don't know whether or not your shield actually works. If you open your IDE, and go to "file"/"examples"/"Etherenet"/"Web server", and compile and upload that, what happens?

(BTW "doesn't work" on this forum is taken to mean "I have correctly compiled and uploaded a sketch, but it doesn't appear to do what I expect", not "it doesn't even compile")

ok i see this :

analog input 0 is 177 analog input 1 is 1023 analog input 2 is 742 analog input 3 is 583 analog input 4 is 416 analog input 5 is 260

one question , what is the code to execute one LED with a simple button on / off ( or 2 buttons )

what is the code to execute one LED with a simple button on / off ( or 2 buttons )

(uncompiled, untested)

const int buttonPin = 2;
const int LEDpin = 13;

void setup ()
{
  pinMode (buttonPin, INPUT);
  digitalWrite (buttonPin, HIGH);
  pinMode (LEDpin, OUTPUT);  // probably not needed
}

void loop ()
{
  digitalWrite (LEDpin, digitalread (buttonPin));
//or maybe digitalWrite (LEDpin, !digitalread (buttonPin));

}

sorry on webserver please... one example

/*
 * Web Server
 *
 * A simple web server that shows the value of the analog input pins.
 */

#include <Ethernet.h>

byte mac[] = { 0x0, 0xCE, 0xA5, 0xED, 0xF0, 0x0D};
byte ip[] = { 192, 168, 0, 64 };

Server server(80);

const int buttonPin = 2;
const int LEDpin = 13;


void setup()
{
  Ethernet.begin(mac, ip);
  server.begin();
  pinMode (buttonPin, INPUT);
  digitalWrite (buttonPin, HIGH);
  pinMode (LEDpin, OUTPUT);  // probably not needed

}

void loop()
{
   digitalWrite (LEDpin, digitalread (buttonPin));
  //or maybe digitalWrite (LEDpin, !digitalread (buttonPin));


  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        // if we've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so we can send a reply
        if (c == '\n' && current_line_is_blank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          
          // output the value of each analog input pin
          for (int i = 0; i < 6; i++) {
            client.print("analog input ");
            client.print(i);
            client.print(" is ");
            client.print(analogRead(i));
            client.println("
");
          }
          break;
        }
        if (c == '\n') {
          // we're starting a new line
          current_line_is_blank = true;
        } else if (c != '\r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    client.stop();
  }
}