Errore usando time.h
sto avendo un errore continuo quando provo compilare questo programma
questo e il codice di errore
mi piacerebbe capire dove sta il problema comunque sia con time.h voglio ottenere l'ora del computer per poi inviarla al mio arduino uno che precessore la informazione e la invierà al mio nokia 5110 lcd
grazie de attenzione.
code: [select]
#include <timealarms.h>
#include <wire.h>
#include <ds1307rtc.h>
#include <lcd5110_graph.h>
#include <time.h>
int pintemp = 0;
lcd5110 myglcd(3, 4, 5, 7, 6);
extern unsigned char mediumnumbers[];
extern unsigned char bignumbers[];
extern unsigned char smallfont[];
extern unsigned char tinyfont[];
extern uint8_t internet [];
int contrast = 60;
int inv = 0;
void setup()
{
serial.begin(9600);
myglcd.initlcd(contrast);
}
void loop()
{
int colon = analogread(pintemp);
float voltage = colon * 5;
voltage /= 1024.0;
int temp = (voltage - 0.5) * 100;
int horas = hour();
myglcd.setfont(smallfont);
myglcd.update();
myglcd.printnumi(temp, 38, 5);
myglcd.drawcircle( 52,5,2);
myglcd.drawbitmap( 69,30, internet,15,15);
myglcd.print("temp =", 0,5);
myglcd.printnumi(horas,center,38);
myglcd.update();
myglcd.update();
delay(1000);
myglcd.clrscr();
delay(1000);
}
questo e il codice di errore
code: [select]
in file included c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:10:0:
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:18:18: error: variable 'monthstr1' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr1[] progmem = "january";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:19:18: error: variable 'monthstr2' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr2[] progmem = "february";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:20:18: error: variable 'monthstr3' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr3[] progmem = "march";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:21:18: error: variable 'monthstr4' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr4[] progmem = "april";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:22:18: error: variable 'monthstr5' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr5[] progmem = "may";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:23:18: error: variable 'monthstr6' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr6[] progmem = "june";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:24:18: error: variable 'monthstr7' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr7[] progmem = "july";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:25:18: error: variable 'monthstr8' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr8[] progmem = "august";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:26:18: error: variable 'monthstr9' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr9[] progmem = "september";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:27:19: error: variable 'monthstr10' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr10[] progmem = "october";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:28:19: error: variable 'monthstr11' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr11[] progmem = "november";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:29:19: error: variable 'monthstr12' must const in order put read-only section means of '__attribute__((progmem))'
char monthstr12[] progmem = "december";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:31:22: error: variable 'monthnames_p' must const in order put read-only section means of '__attribute__((progmem))'
pgm_p monthnames_p[] progmem =
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:37:26: error: variable 'monthshortnames_p' must const in order put read-only section means of '__attribute__((progmem))'
char monthshortnames_p[] progmem = "errjanfebmaraprmayjunjulaugsepoctnovdec";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:39:16: error: variable 'daystr0' must const in order put read-only section means of '__attribute__((progmem))'
char daystr0[] progmem = "err";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:40:16: error: variable 'daystr1' must const in order put read-only section means of '__attribute__((progmem))'
char daystr1[] progmem = "sunday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:41:16: error: variable 'daystr2' must const in order put read-only section means of '__attribute__((progmem))'
char daystr2[] progmem = "monday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:42:16: error: variable 'daystr3' must const in order put read-only section means of '__attribute__((progmem))'
char daystr3[] progmem = "tuesday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:43:16: error: variable 'daystr4' must const in order put read-only section means of '__attribute__((progmem))'
char daystr4[] progmem = "wednesday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:44:16: error: variable 'daystr5' must const in order put read-only section means of '__attribute__((progmem))'
char daystr5[] progmem = "thursday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:45:16: error: variable 'daystr6' must const in order put read-only section means of '__attribute__((progmem))'
char daystr6[] progmem = "friday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:46:16: error: variable 'daystr7' must const in order put read-only section means of '__attribute__((progmem))'
char daystr7[] progmem = "saturday";
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:48:20: error: variable 'daynames_p' must const in order put read-only section means of '__attribute__((progmem))'
pgm_p daynames_p[] progmem = { daystr0,daystr1,daystr2,daystr3,daystr4,daystr5,daystr6,daystr7};
^
c:\users\massimiiano pc study\documents\arduino\libraries\time\datestrings.cpp:49:24: error: variable 'dayshortnames_p' must const in order put read-only section means of '__attribute__((progmem))'
char dayshortnames_p[] progmem = "errsunmontuewedthrfrisat";
^
error compiling.
mi piacerebbe capire dove sta il problema comunque sia con time.h voglio ottenere l'ora del computer per poi inviarla al mio arduino uno che precessore la informazione e la invierà al mio nokia 5110 lcd
grazie de attenzione.
potresti intanto descrivere che os, che modello di arduino e la versione dell ide, che stai usando.
Arduino Forum > International > Italiano > Software (Moderator: leo72) > Errore usando time.h
arduino
Comments
Post a Comment