Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ATParser TSL2561 mbed
Diff: main.cpp
- Revision:
- 1:62d78e5748b6
- Parent:
- 0:c88efeed88e3
- Child:
- 2:8a192ca34bac
--- a/main.cpp Fri Apr 13 15:56:06 2018 +0000
+++ b/main.cpp Tue Apr 17 13:48:34 2018 +0000
@@ -47,24 +47,30 @@
int i = 0;
char *day[24];
+
+
while(1)
{
float lightnum = lightsensor.lux();
- pc.printf("light = %f\n\r", lightnum);
- char light = malloc(sizeof(char)*10);
- day[i] = light;
+ //pc.printf("light = %f\n\r", lightnum);
+ //char light = malloc(10);
+ //light = new char [8];
+ day[i] = new char[8];
+ int n;
+ n = sprintf(day[i], "%f", lightnum);
+ //pc.printf("String transfer worked: %s\n\r", day[i]);
i++;
- int n;
- n = sprintf(light, "%f", lightnum);
- pc.printf("String transfer worked: %s\n\r", light);
-
if (i == 24)
{
int j;
for(j = 0; j < 24; j++)
{
if(at.send("AT+SEND=\"%s\"", day[j]) && 1)
- pc.printf("isesux\n\r");
+ {
+ //pc.printf("%s\n\r", day[j]);
+ pc.printf("success\n\r");
+ //wait(.1);
+ }
else
pc.printf("iserox\n\r");
}