Hello evryone i need some help with code i want to make that after i press the button on web page arduno will recevie signal to turn on led which connected to pin 2 wifly connects to wireless network i getting page on with the button but when i press it wifly shield red led indicates that its reciving communication but i cant turn the ligth on
my HTML part of code is
void loop()
{
// Exit command mode if we haven't already
SPI_Uart_println("exit");
delay(500);
Flush_RX();
while(!Have_Client()); // Wait on client
Serial.println("\n\rConnection opened.");
// Send HTML
HTML_print("<html>");
HTML_print("<title>Led Control</title>");
HTML_print("<h1><center>");
HTML_print("LED CONTROLL");
HTML_print("</center></h1>");
HTML_print("PUSH THE BUTTON");
HTML_print("<form type=\"submit\" action=\"\" method=\"post\">");
// HTML_print("<input type=\"hidden\" name=\"%\" value=\"1\">");
HTML_print("<input type=\"submit\" value=\"%\" method=\"post\">");
HTML_print("</form>");
HTML_print("<h3>NOTHING HAPPENED LOL :)</h3><p>");
HTML_print("</html>");
delay(500);
// Enter command mode and close connection
SPI_Uart_print("$$");
delay(500);
SPI_Uart_println("close");
delay(1000);
SPI_Uart_println("exit");
delay(500);
Serial.println("Connection closed.\n\r");
Flush_RX();
}
and Parse_Request(void) is
void Parse_Request(void)
{
int val=0, i = 0;
int readval;
char printflag = 0;
val = SPI_Uart_ReadByte(RHR);
if((SPI_Uart_ReadByte(LSR) & 0x01))
{
incoming_data = SPI_Uart_ReadByte(RHR);
if(printflag){
val = val;
i++;
}
else if (incoming_data == '%'){
printflag = 1;
}
if (printflag = 1 ){
digitalWrite(val,LOW);
}
else
{
digitalWrite(val,HIGH); //??????
}
}
}
this one supose to send data to arduino
i am using sparkfun tutorial WiFly Wireless Talking SpeakJet Server
and 10 led bar code to control it with c# application
i am just a beginer at programing so need some help with this one
Thank you.