- Như chúng ta biết bảng ARP cache được cập nhật là có 2 trường hợp 1 là gởi bản tin ARP request, 2 mỗi khi có gói tin IP đến thì nó sẽ cập nhật IP và MAC của thằng máy tính đã gởi đị
3-Ta thêm dấu nháy kép vào đầu và cuối mỗi dòng.
4-Copy tất cả, bỏ vào giữa 2 dấu ngoặc nhọn trong khai báo PROGMEM char Page1[] = {};Kết quả ta sẽ được file "webpagẹh" như vầy: Kết quả ta sẽ được file "webpagẹh" như vầy:
Code:
//--- // Writen by NTTam - PTITHCM
//--- #ifndef WEBPAGE_H
#define WEBPAGE_H //
#include <avr/pgmspacẹh>
PROGMEM char Page1[] = {"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd\">"
"<html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" lang=\"en\">" "<head>"
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">" "<title>AVR web server</title>"
"</head>"
"<body style=\"background: #048C04; color: #FFFFFF\">" "<br>"
"<table bgcolor=\"#489D48\" border=\"0\" width=\"975\" cellpađing=\"0\" cellspacing=\"0\" align=\"center\">"
"<tbody>" "<tr>"
"<td height=\"31\" align=\"center\">"
"<div style=\"font-size:48pt; color:#F4FC8F\"><strong>REMOTE CONTROL AVR WEBSERVER</strong></div>"
"</td>" "</tr>" "</tbody>" "</table>"
"<tbody>" "<tr>" "<td>" "<br>"
"<div align=\"center\">"
"<div style=\"background: #ffffff; color: #000000; width:975px; text- align:left\">"
"<div style=\"pađing:0px 15px 0px 15px\" align=\"left\">" "<br>"
"<table style=\"background: #999999; color: #000000; border: 1px solid #6581c1\" cellpađing=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\">"
"<tbody>"
"<tr style=\"background: #FFFFFF; color: #545454; border-left: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF\">"
"<td width=\"100%\">"
"<div style=\"font-size:10pt\"><strong>DESIGNER: THANH - TAM</strong></div>" "</td>" "<td nowrap=\"nowrap\" style=\"pađing:0px\">" "</td>" "</tr>" "</tbody>" "</table>" "<br>"
"<table style=\"background: #999999; color: #000000; border: 1px solid #6581c1\" cellpađing=\"6\" cellspacing=\"1\" border=\"0\" width=\"100%\" align=\"center\">"
"<thead>"
"<tr valign=\"top\">"
"<td style=\"background: #FFFFFF; color: #048C04\" colspan=\"3\"><strong>Remote control webserver with ATmega32</a></strong></td>"
"</tr>" "</thead>"
"<tbody id=\"collapseobj_vietvbb_stats\" style=\"\">" "<tr>"
"<td style=\"background: #FFFFFF; color: #545454; border-left: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF\">"
"<table border=\"1\" cellpađing=\"0\" cellspacing=\"0\" width=\"100%\">" "<tbody>" "<tr style=\"font-size:12pt\">" "<td style=\"pađing: 5px 5px 5px 5px;\" width=\"25%\">" "<div>" "<strong>Camera view</strong>" "</div>" "</td>" "<td style=\"pađing: 5px 5px 5px 5px;\" width=\"25%\">" "<div>" "<strong>Devices control</strong>" "</div>" "</td>" "<td style=\"pađing: 5px 5px 5px 5px;\" width=\"50%\">" "<div>" "<strong>Sensors</strong>" "</div>" "</td>" "</tr>"
"<tr style=\"font:bold 12pt\">"
"<td style=\"pađing: 5px 5px 5px 5px;\" width=\"25%\">"
"<div id=\"vietvbb_topstats_s_content\" style=\"display: block;\">" "<img src=\"http://d.f5.photọzdn.vn/upload/original/2011/06/19/1/24/130842147558565 9804_574_0.jpg\" width=\"320\" height=\"240\" />" "</div>" "</td>" "<td style=\"pađing: 5px 5px 5px 5px;\" width=\"25%\">" "<div>"
"<form method=\"POST\" action=\"\">"
"<p align=\"left\"><input type=\"checkbox\" name=\"RELAY1\" value=\"ON\"%RL1>Relay 01</p>"
"<p align=\"left\"><input type=\"checkbox\" name=\"RELAY2\" value=\"ON\"%RL2>Relay 02</p>"
"<p align=\"left\"><input type=\"checkbox\" name=\"RELAY3\" value=\"ON\"%RL3>Relay 03</p>"
"<p align=\"left\"><input type=\"checkbox\" name=\"RELAY4\" value=\"ON\"%RL4>Relay 04</p>"
"<p align=\"left\"><input type=\"submit\" value=\"Submit\" name=\"CTRL\"></p>" "</form>"
"</div>" "</td>"
"<td style=\"pađing: 5px 5px 5px 5px;\" width=\"50%\">" "<div>"
"<table border=\"1\" width=\"100%\" id=\"table1\">" "<tr>" "<td>Environment Sensors</td>" "<td width=\"42\">Value</td>" "<td width=\"33\">Unit</td>" "<td width=\"150\"> </td>" "</tr>" "<tr>" "<td>Sensor 01</td>" "<td width=\"42\">%AD0</td>" "<td width=\"33\"><sup>o</sup>C</td>" "<td width=\"150\"> </td>" "</tr>" "<tr>" "<td>Sensor 02</td>" "<td width=\"42\">%AD1</td>" "<td width=\"33\"><sup>o</sup>C</td>" "<td width=\"150\"> </td>" "</tr>" "</table>" "</div>" "</td>" "</tr>" "</tbody>" "</table>" "</td>" "</tr>" "</tbody>" "</table>"
"<br><br><br>"
"<div align=\"center\">Timezone: GMT+7. Current time <span>%TI</span>.</div>" "<br>"
"</div>" "</div>" "</div>"
"<form action=\"footer\" method=\"get\">" "<br>"
"<div align=\"center\">"
"<div align=\"center\">Designed by thanh - tam</div>" "</div>" "</form>" "</td>" "</tr>" "</tbody>" "</table>" "</div>" "</body>" "</html>"}; //--- #endif //WEBPAGE_H