Changeset 14513 for firmware/InterlockArduino
- Timestamp:
- 10/24/12 09:17:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
firmware/InterlockArduino/src/webserver/webserver.ino
r14512 r14513 77 77 "cam_on", 78 78 "cam_off", 79 "d rive_toggle"};79 "dt"}; // read drive_toggle 80 80 81 81 // outputs … … 108 108 void setup() { 109 109 // Open serial communications and wait for port to open: 110 Serial.begin(9600); 110 // Serial.begin(9600); 111 Serial.begin(19200); 111 112 112 113 … … 166 167 { 167 168 eth += c; 168 //Serial.write(c); 169 //Serial.println(eth.length(), DEC); 169 Serial.write(c); 170 Serial.print(' '); 171 Serial.print(c, HEX); 172 Serial.print(' '); 173 Serial.println(eth.length(), DEC); 170 174 if ( eth.indexOf('\n') != -1 ) 171 175 { … … 173 177 { 174 178 get_http_found = true; 175 if (eth.indexOf(String("cam_on=")) !=-1){ 179 // -- Cam on -- 180 if (eth.indexOf(String(button_name[0])) !=-1){ 176 181 Serial.println("User request: Enable Pump"); 177 182 digitalWrite( FC_ON, HIGH); … … 179 184 fc_on_time += 3000; 180 185 } 181 else if (eth.indexOf(String("cam_off=")) !=-1) 186 // -- Cam Off -- 187 else if (eth.indexOf(String(button_name[1])) !=-1) 182 188 { 183 189 Serial.println("User request: Disable Pump"); … … 185 191 fc_off_time = 500; 186 192 } 187 else if (eth.indexOf(String("drive_toggle=")) !=-1) 193 // -- Drive Toggle -- 194 else if (eth.indexOf(String(button_name[2])) !=-1) 188 195 { 189 196 Serial.println("User request: Toggle Drive"); … … 204 211 } 205 212 206 //Serial.println("found it");213 Serial.println("found it"); 207 214 } 208 215 } … … 243 250 { 244 251 // send a standard http response header 245 client->print ln("HTTP/1.1 200 OK");246 client->print ln("Content-Type: text/html");247 client->print ln("Connnection: close");248 client->print ln();249 client->print ln("<!DOCTYPE HTML>");250 client->print ln("<html><head>");252 client->print("HTTP/1.1 200 OK\n"); 253 client->print("Content-Type: text/html\n"); 254 client->print("Connnection: close\n"); 255 client->print("\n"); 256 client->print("<!DOCTYPE HTML>\n"); 257 client->print("<html><head>\n"); 251 258 252 259 // add a meta refresh tag, so the browser pulls again every 5 seconds: 253 client->print ln("<meta http-equiv=\"refresh\" content=\"5; URL=index.html\" />");254 client->print ln("<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />");255 256 client->print ln("<title>FACT camera power interlock control</title></head><body>");257 client->print ln("<FORM NAME=\"Form\">");260 client->print("<meta http-equiv=\"refresh\" content=\"5; URL=index.html\" />\n"); 261 client->print("<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\" />\n"); 262 263 client->print("<title>FACT camera power interlock control</title></head><body>\n"); 264 client->print("<FORM NAME=\"Form\">\n"); 258 265 } 259 266 … … 278 285 //client->print(" No "); 279 286 } 280 client->print ln("</span> <br />");287 client->print("</span> <br />\n"); 281 288 } 282 289 } … … 298 305 } 299 306 300 client->print ln("><br />");307 client->print("><br />\n"); 301 308 } 302 309 }
Note:
See TracChangeset
for help on using the changeset viewer.