PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Echo.ino 1015B

3 yıl önce
12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include <AltSoftSerial.h>
  2. // AltSoftSerial always uses these pins:
  3. //
  4. // Board Transmit Receive PWM Unusable
  5. // ----- -------- ------- ------------
  6. // Teensy 3.0 & 3.1 21 20 22
  7. // Teensy 2.0 9 10 (none)
  8. // Teensy++ 2.0 25 4 26, 27
  9. // Arduino Uno 9 8 10
  10. // Arduino Leonardo 5 13 (none)
  11. // Arduino Mega 46 48 44, 45
  12. // Wiring-S 5 6 4
  13. // Sanguino 13 14 12
  14. // This example code is in the public domain.
  15. AltSoftSerial altSerial;
  16. void setup() {
  17. Serial.begin(9600);
  18. while (!Serial) ; // wait for Arduino Serial Monitor to open
  19. Serial.println("AltSoftSerial Test Begin");
  20. altSerial.begin(9600);
  21. altSerial.println("Hello World");
  22. }
  23. void loop() {
  24. char c;
  25. if (Serial.available()) {
  26. c = Serial.read();
  27. altSerial.print(c);
  28. }
  29. if (altSerial.available()) {
  30. c = altSerial.read();
  31. Serial.print(c);
  32. }
  33. }