본문 바로가기
카테고리 없음

아두이노에서 문장 만들기 #2

by 오징어땅콩2 2020. 2. 4.
반응형

자 그러면 약간의 응용으로 가죠.

검색하면 구글맵을 이용해서 네비게이션 처럼 구글맵을 출력하는 HTML 코드가 있습니다.

그것을 문장으로 만들어 보죠.

 

아두이노 우노와 ESP8266, GPS 모듈을 이용한 WEB출력

 

void Web_Page1(ESP8266& wifi)
{
  // start sending the HTML
  String webpage;
  String result;
  char buf1[256];
  webpage = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n";
  webpage += "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"ko\">\r\n";
  webpage += "<head>\r\n";
  webpage += "<meta http-equiv=\"Content-Type\" content=\"application/xhtml+xml; charset=utf-8\" />\r\n";
  webpage += "<meta name=\"viewport\" content=\"user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width\" />\r\n";
  webpage += "<link href=\"http://code.google.com/apis/maps/documentation/javascript/examples/standard.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n"
  webpage += "<script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false&language=ko\"></script>\r\n"
  webpage += "<script  type=\"text/javascript\">\r\n"
  webpage += "function initalize() {\r\n";
  webpage += "    var mapOptions = {\r\n";
  webpage += "      zoom: 15,\r\n";
  sprintf(buf1, "      center: new google.maps.LatLng(%s, %s),\r\n", String(Latitude,3).c_str(), String(Longitude,3).c_str());
  webpage +=  String(buf1); 
  webpage += "      disableDefaultUI: true,\r\n";
  webpage += "      mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n";
  webpage += "    draggable: false}\r\n";
  webpage += " var map = new google.maps.Map(document.getElementById(\"map_canvas\"), mapOptions);\r\n";
  webpage += " var marker = new google.maps.Marker({map: map, position: map.getCenter()});\r\n";
  webpage += "}\r\n";
  webpage += "</script>\r\n"
  webpage += "<title> Google Map JavaScript API </title>\r\n";
  webpage += "</head>\r\n";
  webpage += "<body onload=\"initalize()\"> \r\n";
  webpage += "<div id=\"map_canvas\" style=\"width: 640px; height: 480px; margin: 0 auto; top:50px; border: 1px solid black;\"> </div>\r\n";
  webpage += "</body>\r\n";
  webpage += "</html>\r\n";
  
  delay(500);
  
  //Web_Close();
  return ;
}
 
http://colorscripter.com/info#e" target="_blank" style="color:#e5e5e5text-decoration:none">Colored by Color Scripter

댓글