Hello,
I am currently trying to run this code
#include <SPI.h>
#include <Ethernet.h>
#include "plotly_streaming_ethernet.h"
// I change my tokens and API keys to something generic
// Plot.ly Tokens:
#define nTraces 4
char *tokens[nTraces] = {"tokens1", "tokens2", "tokens3", "tokens4"};
// arguments: username, api key, streaming token, filename
plotly graph("Hohokam337", "API_KEYZ", tokens, "TITLE", nTraces);
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte my_ip[] = { 199, 168, 1, 177 }; // google will tell you: "public ip address"
void startEthernet(){
Serial.println("... Initializing ethernet");
if(Ethernet.begin(mac) == 0){
Serial.println("... Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, my_ip);
}
Serial.println("... Done initializing ethernet");
delay(1000);
}
void setup() {
graph.maxpoints = 100;
// Open serial communications and wait for port to open:
Serial.begin(9600);
startEthernet();
graph.fileopt="overwrite";
bool success;
success = graph.init();
if(!success){while(true){}}
graph.openStream();
}
int SV, WV;
void loop() {
float SI = 0;{
for(int i = 0; i < 1000; i++) {
SI = SI + (.0264 * analogRead(A0) -13.51) / 1000;}
}
float WI = 0;{
for(int i = 0; i < 1000; i++) {
WI = WI + (.19 * analogRead(A0) -25) / 1000; }
}
SV = (analogRead(A0)*.239);
WV = (analogRead(A3)*.325);
graph.plot(millis(), SV, tokens[0]);
graph.plot(millis(), SI, tokens[1]);
graph.plot(millis(), WV, tokens[2]);
graph.plot(millis(), WI, tokens[3]);
}
When I run this I get there error:
C:\Program Files (x86)\Arduino\libraries\plotly_streaming_ethernet\plotly_streaming_ethernet.cpp:6:25: fatal error: avr/dtostrf.h: No such file or directory
#include <avr/dtostrf.h>
Now I saw that this issue was covered for earlier Arduino editions but none of the solutions have worked for me.
Any help will be greatly appreciated.
Hohokam