I'm using a library to post on twitter. It's basically this:
sensorValue = analogRead(sensorPin); // Reads a LDR @ A0
if (sensorValue < 100)
{
Serial.println("Nobody on the living room... forever alone!!!");
char msg[] = "Nobody on the living room... forever alone!!!";
twitter.post(msg);
...
No problems up to this point.
But twitter usually doesn't accept repeated messages from external apps.
So my problem is that I'm trying to use a counter or something just to make some difference between texts.
Then I tried these codes:
1st one:
...
counter++; //declared as int in the beggining of the program
char msg[] = "Nobody on the living room... forever alone!!! Counter: "+counter;
Serial.println("Nobody on the living room... forever alone!!! Counter: "+counter);
Didn't work!!
2nd one:
...
counter++; //declared as int in the beggining of the program
const String s("Nobody on the living room... forever alone!!! Counter: "+counter);
char charArray[45];
((String)s).toCharArray(charArray, 45);
char msg[] = charArray;
Serial.println("Nobody on the living room... forever alone!!!"+counter);
The message i receive when i try to compile is: initializer fails to determine size of 'msg'
Do you guys have any suggestion?!
This is such an idiot thing, but i'm really stuck here!!!