本文整理汇总了C++中LiquidCrystal::println方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal::println方法的具体用法?C++ LiquidCrystal::println怎么用?C++ LiquidCrystal::println使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiquidCrystal
的用法示例。
在下文中一共展示了LiquidCrystal::println方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void setup()
{
RFID.begin(9600); // start serial to RFID reader
Serial.begin(9600); // start serial to PC
lcd.begin(16, 2);
//lcd output
lcd.clear();
lcd.print("There are "); //start printing the result
lcd.print(space_left); //then how many spaces
lcd.print(" spaces left."); //words
lcd.println(" "); //spaces
for (int i = 0; i < 5; i++)
{
id_marker[i] = 0;
}
Serial.println("Ready!");
//sets everything in the array equal to blank
for(int i=0; i<5; i++)
{
id_array[i] = String("");
}
}
示例2: loop
void loop()
{
int i;
while (RFID.available() <= 0); // force wait until rfid present
if(RFID.available() > 0) //does rfid exist?
{
i = 0;
while (i < 14)
{
tag_id = RFID.read(); //Reads character, puts into tag_id
if (tag_id == '-1') //Wait for scan to read
continue;
id_string = String(id_string + tag_id); //Make it a string
//TESTING OUTPUT
//For some reason, getting rid of this makes the tag not read correctly
Serial.print("Read: ");
Serial.print(tag_id);
Serial.print("\nid_string is now ");
Serial.print(id_string);
i++; //counts up unil 14
}
//TESTING OUTPUT
Serial.print("\nid_string is now ");
Serial.print(id_string);
for(int index=0; index<5; index++) //first we check to see if there are any current matches
{
if(id_string == id_array[index]) //if the id matches something in the array at location "i"
{
Serial.println("Match"); //print that it matches.
id_array[index] = String(""); //set the array location of the removed tag to blank
if (id_marker[index] == 1) //if the id marker is equal to one
//else //Removing this else because I dont think it makes sense.
{
// space_left++; //this isnt properly increasing the spaces left
//Commented out space left above because theres also one below.
// not sure if this is necessary
for (int j = index; j < 4; j++) //what purpose does j serve? Increments the search?
{
id_string[j] = id_string[j + 1];
id_marker[j] = id_marker[j + 1];
Serial.println(id_marker[index]); //test print for the current marker.
}
index--; //this might actually only subtract the last place, and not the proper location
space_left++;
no_match = 1;
}
}
}//End of for loop
//I added the ifs below to attempt to refine the location of the write location in the array. they dont work completely
if (no_match == 0)
{
if (id_array[index] != String("")) //if the array location is not blank, then
{
index ++; //increment to the next spot
Serial.println(i);
}
if (index == 5) //if we're at the 5th spot
{
index = 0; //start back at zero
}
//this needs to be able to detect black values
id_array[index] = id_string;
id_marker[index]++;
space_left--;
}
}
Serial.println(" "); // prints a space
Serial.println(id_array[index]); // print the array item
Serial.println("Finished Reading ID."); //prints out this on a line
Serial.print("There are "); //start printing the result
Serial.print(space_left); //then how many spaces
Serial.print(" spaces left."); //words
Serial.println(" "); //spaces
//lcd output
lcd.clear();
lcd.print("There are "); //start printing the result
//.........这里部分代码省略.........