streaming_example.pde 691 B

12345678910111213141516171819202122
  1. #include <Streaming.h>
  2. void setup()
  3. {
  4. Serial.begin(9600);
  5. int lettera = 'A';
  6. int month = 4, day = 17, year = 2009;
  7. Serial << "This is an example of the new streaming" << endl;
  8. Serial << "library. This allows you to print variables" << endl;
  9. Serial << "and strings without having to type line after" << endl;
  10. Serial << "line of Serial.print() calls. Examples: " << endl;
  11. Serial << "A is " << lettera << "." << endl;
  12. Serial << "The current date is " << day << "-" << month << "-" << year << "." << endl;
  13. Serial << "You can use modifiers too, for example:" << endl;
  14. Serial << _BYTE(lettera) << " is " << _HEX(lettera) << " in hex. " << endl;
  15. }
  16. void loop()
  17. {}