Hello,
Thanks for the answer, is that the only chance?
I was expecting a simple solution, send the string and that's it.
Can you point me a direction to follow.
here what i could do until now
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x35, 0x6C }; // define mac
EthernetServer server = EthernetServer(80); // define server port
void setup(){
Serial.begin(9600); // activat serial port
pinMode(2, OUTPUT); // LED indicator for camera ON
pinMode(3, OUTPUT); // LED indicator for position 1
pinMode(4, OUTPUT); // LED indicator for position 2
pinMode(5, OUTPUT); // LED indicator for position 3
pinMode(6, OUTPUT); // LED indicator for position 4
pinMode(14, INPUT); // Push button for camera ON
pinMode(15, INPUT); // Push button for position 1
pinMode(16, INPUT); // Push button for position 2
pinMode(17, INPUT); // Push button for position 3
pinMode(18, INPUT); // Push button for position 4
Ethernet.begin(mac); // register mac with DHCP
server.begin(); //start net server
Serial.println(Ethernet.localIP()); // print IP local
}
void loop(){
//test buttons
testCAM(14);
testinput(15);
testinput(16);
testinput(17);
testinput(18);
}
void testCAM(int pin){
//test input and activate output.
if (digitalRead(pin) == LOW){
digitalWrite (2, HIGH);} //activate LED
//http://192.168.1.100:8081/?L1=1 //Send string
else{
digitalWrite (2, LOW);}
//http://192.168.1.100:8081/?L1=0 //Send string
}
void testinput(int pin){
//test input and activate output.
if (digitalRead(pin) == LOW){
digitalWrite ((pin-12), HIGH);} //activate LED
//http://192.168.1.100:8085/Set?Func=PresetCntPos&Kind=1 //Send string
else{
digitalWrite ((pin-12), LOW);}
}
Thanks again.
Timóteo