Close

Code progress

A project log for BikePin

BikePin is a small device hidden in the construction of a bicycle which its owner can message and the device will send the bike’s location

marin-vukosavMarin Vukosav 05/19/2019 at 20:470 Comments

Added new script to the existing repository: New source code

Serial.print("Now, entering SMS content: ");
  char str1[16];
  char str2[16];
  dtostrf(gps.location.lat(), 10, 6, str1);
  dtostrf(gps.location.lng(), 10, 6, str2);

  char str3[4]= ",";
  char str [160] = "https://www.google.com/maps/place/";
  strcat(str, str1);
  strcat(str, str3);
  strcat(str, str2);

This is the content that is sent and also displayed on the other side.

bool RTCinit(uint8_t interruptPin, function_ptr alarmISR);
time_t RTCsetNewTime(time_t dataTime);
void RTCsleepNow();
void RTCprint(time_t t);
time_t RTCsetNextAlarm(uint16_t sleepPeriod);

Declaration of RTC functions that are crucial for maintaining the work flow of the device and keeping it up and running only when needed 

That is where the key word come in hand and in this case it is set to "GPS"

char x[15]="GPS";
if (sms.available()) {
    Serial.println("Message received from:");
    sms.remoteNumber(senderNumber, 20);}

Discussions