adafruit / Adafruit_FONA

Arduino library for the Adafruit FONA
https://www.adafruit.com/products/1946
211 stars 237 forks source link

Pass variable to send SMS #127

Closed mohammadbax98 closed 3 years ago

mohammadbax98 commented 3 years ago

Hello. For examples, you use this code: fona.sendSMS(callerIDbuffer, "Hey, I got your text!") But I can't pass any variable. I get "no matching function for call to 'Adafruit_FONA::sendSMS(char [32], String)'" I test this simple code and it does not work!

String test = "Hey, I got your text!"; fona.sendSMS(callerIDbuffer, test)

I want to pass for example my sensor humidity and temperature. how can I fix this problem?

ladyada commented 3 years ago

use sprintf or some other way to generate a string. check arduino forums for support.