Completado

ESP8266 code for graphing the ADC

I need some code to graph the analog to digital pin of the esp8266.

I have some sample code.

#include <ESP8266WiFi.h>

#include <WiFiClient.h>

#include <ESP8266WebServer.h>

#include <ESP8266mDNS.h>

const char *ssid = "YourSSIDHere";

const char *password = "YourPSKHere";

ESP8266WebServer server ( 80 );

const int led = 13;

void handleRoot() {

digitalWrite ( led, 1 );

char temp[400];

int sec = millis() / 1000;

int min = sec / 60;

int hr = min / 60;

snprintf ( temp, 400,

"<html>\

<head>\

<meta http-equiv='refresh' content='5'/>\

<title>ESP8266 Demo</title>\

<style>\

body { background-color: #cccccc; font-family: Arial, Helvetica, Sans-Serif; Color: #000088; }\

</style>\

</head>\

<body>\

<h1>Hello from ESP8266!</h1>\

<p>Uptime: %02d:%02d:%02d</p>\

<img src=\"/[login to view URL]\" />\

</body>\

</html>",

hr, min % 60, sec % 60

);

[login to view URL] ( 200, "text/html", temp );

digitalWrite ( led, 0 );

}

void handleNotFound() {

digitalWrite ( led, 1 );

String message = "File Not Found\n\n";

message += "URI: ";

message += [login to view URL]();

message += "\nMethod: ";

message += ( [login to view URL]() == HTTP_GET ) ? "GET" : "POST";

message += "\nArguments: ";

message += [login to view URL]();

message += "\n";

for ( uint8_t i = 0; i < [login to view URL](); i++ ) {

message += " " + [login to view URL] ( i ) + ": " + [login to view URL] ( i ) + "\n";

}

[login to view URL] ( 404, "text/plain", message );

digitalWrite ( led, 0 );

}

void setup ( void ) {

pinMode ( led, OUTPUT );

digitalWrite ( led, 0 );

[login to view URL] ( 115200 );

[login to view URL] ( WIFI_STA );

[login to view URL] ( ssid, password );

[login to view URL] ( "" );

// Wait for connection

while ( [login to view URL]() != WL_CONNECTED ) {

delay ( 500 );

[login to view URL] ( "." );

}

[login to view URL] ( "" );

[login to view URL] ( "Connected to " );

[login to view URL] ( ssid );

[login to view URL] ( "IP address: " );

[login to view URL] ( [login to view URL]() );

if ( [login to view URL] ( "esp8266" ) ) {

[login to view URL] ( "MDNS responder started" );

}

[login to view URL] ( "/", handleRoot );

[login to view URL] ( "/[login to view URL]", drawGraph );

[login to view URL] ( "/inline", []() {

[login to view URL] ( 200, "text/plain", "this works as well" );

} );

[login to view URL] ( handleNotFound );

[login to view URL]();

[login to view URL] ( "HTTP server started" );

}

void loop ( void ) {

[login to view URL]();

}

void drawGraph() {

String out = "";

char temp[100];

out += "<svg xmlns=\"[login to view URL]\" version=\"1.1\" width=\"400\" height=\"150\">\n";

out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n";

out += "<g stroke=\"black\">\n";

int y = rand() % 130;

for (int x = 10; x < 390; x+= 10) {

int y2 = rand() % 130;

sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2);

out += temp;

y = y2;

}

out += "</g>\n</svg>\n";

[login to view URL] ( 200, "image/svg+xml", out);

}

Habilidades: Arduino, Programación en C, Ingeniería eléctrica, Electrónica, Microcontrolador

Ver más: esp8266 adc unstable, esp8266 read battery voltage, esp8266 analog input range, esp8266 external adc, esp8266 multiple adc, esp8266 adc reference voltage, esp8266 adc example, esp8266 adc sample rate, i need a code for programming, i need a swift code, i need someone to search for movie names through a website visit the link get the embed code and submit it on my website i need , i need someone highly experienced about undesrtand a site code in order to alterate some behavior to do some not natural actions, i need programmer write code, i need php code for creating mobile tracker, i need existing source code for a job portal to be delivered in 12 days, i need existing source code for a job portal to be delivered in 1-2 days, i need an android coder to check up my code, i need a statistical graph, i need a pic16f873a computer programmers who can help me write the microcontroller code, i need a matlab and c++ code is to be written

Información del empleador:
( 50 comentarios ) campbell, United States

Nº del proyecto: #15595497

Adjudicado a:

anhvu100

What's your specific requirement? I compiled your sample code and it is OK although it can be enhanced, for example, using ajax and using WiFi Manager to connect to WiFi. Relevant Skills and Experience ESP8266, HTML, Más

$200 USD en 5 días
(24 comentarios)
5.3

19 freelancers están ofertando el promedio de $168 para este trabajo

mechatronicsengr

Hi I hope you are doing well. I have experience in esp8266 based webserver development. I have understood your project requirements and I can execute it in less possible time. Looking Forward Khawaja

$200 USD en 7 días
(72 comentarios)
6.5
umg536

please ignore the bid amount we will discuss the price later in the chat after we have discussed the project thoroughly Relevant Skills and Experience: . Proposed Milestones: 190 - . Hi robobobo! please inbox me to dis Más

$190 USD en 2 días
(14 comentarios)
6.0
microembedded

hi i am an electrical engineer. i have vast experience related to esp8266 and its programming. i have done many embedded system projects. Relevant Skills and Experience i have hardware experience with esp8266. let me Más

$250 USD en 5 días
(33 comentarios)
6.3
SPARKtechBD

Read and checked your project description. It is not clear that what you want. Please mark your requirements clearly. However, I like to work in this project as I have Arduino experience. Relevant Skills and Experienc Más

$250 USD en 7 días
(12 comentarios)
5.6
sanja1989

As I understand you need to read signal from ADC, save it and then show as SVG. Do you want to automatically update graph? How much data do you want to show? Relevant Skills and Experience I have experience in coding Más

$30 USD en 2 días
(17 comentarios)
5.1
ZhongxinTech112

I have a lot of experience in ESP8266 1~12E wifi module. Please visit in my bitbucket:[login to view URL] You can see my previous project assouciated with esp8266. Relevant Skills and Experience c Más

$222 USD en 3 días
(11 comentarios)
4.4
jitendrabaraiya

I can do your job.

$222 USD en 20 días
(7 comentarios)
4.4
$155 USD en 3 días
(3 comentarios)
3.0
sanakashif906

A proposal has not yet been provided

$277 USD en 6 días
(4 comentarios)
2.7
dilshodm

hello, I can help with this project. Can you describe, please, what is the rate of ADC data sampling and what is the timeframe for the data showed on the graphic? I.e. 5 seconds of data.

$166 USD en 7 días
(2 comentarios)
1.5
farispcb

Hi, I have experience with arduino, electronics, developing schematic and developing PCB layout. I worked on projects like a smartHome system. I use Arduino IDE for ESP8266 programming. Faris M. Relevant Skills and Ex Más

$177 USD en 4 días
(1 comentario)
0.8
EddyMiner

A proposal has not yet been provided

$35 USD en 3 días
(0 comentarios)
0.0
$32 USD en 7 días
(0 comentarios)
0.0
$111 USD en 3 días
(0 comentarios)
0.0
$155 USD en 3 días
(0 comentarios)
0.0
kenzanin

I have esp8266 and iam using it for my work as embedded designer.

$166 USD en 10 días
(0 comentarios)
0.0
$133 USD en 5 días
(0 comentarios)
0.0
MahmoudBahie

Hello Consider it done just tell me what exactly you want to do .

$222 USD en 4 días
(0 comentarios)
0.0