Data exceeds memory

Status
Not open for further replies.

Hazieqbento

Newbie
Joined
Nov 2, 2022
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
13
C:
#include <OneSheeld.h>
char* gps = "gps";
char* stopp = "stop";
float lat ;                         
float lon ;
int lock = 12;
char charlat [12];
char charlon [12];
char readings [80];
boolean flag1 = false;
boolean flag2 = false;
boolean flag3 = false;
void setup()
{
  OneSheeld.begin();
  pinMode(lock,OUTPUT);
}
void loop() {
  if(abs(AccelerometerSensor.getY()) > 1.5 )
  {
    if(!flag1)
    {
      SMS.send("01004078579","The car is moving !!");
      flag1 = true;
    }
  }
   if(!strcmp(SMS.getSms(),stopp))
  {
    if(!flag2)
    {
      digitalWrite(lock,HIGH);
      flag2 = true;
    }
  }
  if(!strcmp(SMS.getSms(),gps))
  {
    if(!flag3)
    {
      lat = GPS.getLatitude();
      lon = GPS.getLongitude();
      dtostrf(lat, 11, 7, charlat);
      dtostrf(lon, 11, 7, charlon);
      strcat(readings,"latitude is : ");
      strcat (readings,charlat);
      strcat(readings,"\nLongitude is : ");
      strcat (readings,charlon);
      SMS.send("01004078579",readings);                           
      flag3 = true;
    }                                     
  }
}

[code tags added by moderator]
 
Last edited by a moderator:

Hi,

I don´t even see a descripton of the proplem, nor do I see a clear question.

Klaus
 

Is

Code:
char readings [80];

declared too small for total worst case length needed ?


Regards, Dana.
 

Hello!

A few hints for asking a question:
- Some basic politeness could help (for instance, say hello, please, thanks, etc).
- Describe what you want to do and where you are stuck.
For example which data exceeds which memory would help.

Best regards,

Dora.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…