Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Micro controller Programming

Status
Not open for further replies.
If we give Serial data input =GETID it sholud save as String in SD card, then if we give second input it should print in 2nd line SD card as String.once every string Print in SD card then new line should print
 
void setup()
{
Serial.println(ddd("EDF"));
}
void loop ()
{
getcommand();
}
void getcommand()
{
if(inputdata==SET99FMTCRD#)
{
if(FMTCRD)
{
Serial.print("FMT done");
}
else {
Serial.print("FMT Failed");
}
}
String ddd(String ff)
{
String adddata;
adddata= " Getdata";
ff+= adddata;
return ff;
}
bool FMTCRD()
{
for (j=0;j<=15;j++)
{
Serial.println(ddd("ASDFRTG"));
}
return true;
}


The output i'm getting is:
when the serial begins it prints : EDF Getdata

when we give serial input " SET99FMTCRD#
it prints FMT done and 15 new lines only...it unable to print the string which we passed to function ddd called inside the function FMTCRD...
please anybody help me to solve this issue.

The output is :
EDFKarthik

















FMT Done
 
When i give serial input data it print in lcd along with one special character.....
For Example:
input = Get Data

lcd = Get Data#

Anybody help me to solve this issue.
 
Is the character always at the end? In the string library there are string functions to eliminate characters from strings.

If you use '#' as the delimiting character on 'strtok()' You can get rid of it...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top