[SOLVED] Help with "dynamic" statement with string and pin state
here code:
i need complete code next (my pseudo code)
if txt message status next:
if pinstatus == 1
sting is: relay 'pin' on
else
string is: relay 'pin' off
sms.remotenumber(remotenumber, 10);
sms.beginsms(remotenumber);
sms.print(string);
sms.endsms();
my brain stuck, mean stuck @ how create 1 string 2 states.
code: [select]
else if (txtmsg.compareto("status") == 0)
{
string statustxt = "";
pinstate = digitalread(pin);
if (pinstate == 1){
sms.remotenumber(remotenumber, 10);
sms.beginsms(remotenumber);
sms.print(statustxt);
sms.endsms();
}
}
i need complete code next (my pseudo code)
if txt message status next:
if pinstatus == 1
sting is: relay 'pin' on
else
string is: relay 'pin' off
sms.remotenumber(remotenumber, 10);
sms.beginsms(remotenumber);
sms.print(string);
sms.endsms();
my brain stuck, mean stuck @ how create 1 string 2 states.
quote
my brain stuck, mean stuck @ how create 1 string 2 states.
probably because isn't want do. want create string (or string) 1 of 2 different states.
code: [select]
char stg[32];
if(i == 27)
strcpy(stg, "the value 27");
else
strcpy(stg, "the value not 27");
random
indenting
even in
psuedo code
isn't
good
idea.
Arduino Forum > Using Arduino > Programming Questions > [SOLVED] Help with "dynamic" statement with string and pin state
arduino
Comments
Post a Comment