WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

print

Prints the value of a number, or a string, to the stream.
Syntax
Stream. print(c)
Stream. print(str)
Stream. print(n)
Stream. print(r)
Stream. print(n,base)
Stream. print(r,decPlaces)
Stream. print(stream)
Stream. print(sensor)
 
Parameters
TypeNameDescription
'c'
The character to be sent to the stream.
'str'
The string, in RAM, that you want to print to the stream.
'n'
The integer number you want to print to the stream.
'r'
The real number you want to print to the stream.
'base'
The number base you want to use for the number. ie 10=decimal, 16=hexadecimal, 2=binary, 8=octal.
'decPlaces'
The number of decimal places to be shown to the right of the decimal point.
'stream'
Reference to another stream.
'sensor'
The name of the sensor that you want to dump to the stream.
Returns
None
Note
When you run the code generation in Project Designer you can define the standard output and standard error destinations. WebbotLib will automatically define the following streams to those devices:-
cout - An output stream to the 'standard output' device.
cin - An input stream from the 'standard output' device.
err - An output stream to the 'standard error' device.
Example
// Print stuff to the standard output device
cout.print("Hello World\r\n");
cout.print(12);
cout.print(12.3456); // default to 2 decimal places
cout.print(12.3456,4); // uses 4 decimal places
cout.print( 'A' );
// Copy all incoming data to standard out
cout.print( cin );
// Dump the sensor called 'myCompass'
cout.print( myCompass );
You can also call the print routine multiple times:
cout.print("The answer is ").print(12);
Streams also support the '<<' operator:
cout << "The answer is " << 12;
cout << "myCompass readings: " << myCompass;
See Also
print_P
println

 

 

Valid XHTML 1.0 Transitional