PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

International.pde 1023B

pirms 3 gadiem
12345678910111213141516171819202122232425262728293031323334
  1. /* PS2Keyboard library, International Keyboard Layout Example
  2. http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
  3. keyboard.begin() accepts an optional 3rd parameter to
  4. configure the PS2 keyboard layout. Uncomment the line for
  5. your keyboard. If it doesn't exist, you can create it in
  6. PS2Keyboard.cpp and email paul@pjrc.com to have it included
  7. in future versions of this library.
  8. */
  9. #include <PS2Keyboard.h>
  10. const int DataPin = 8;
  11. const int IRQpin = 5;
  12. PS2Keyboard keyboard;
  13. void setup() {
  14. //keyboard.begin(DataPin, IRQpin, PS2Keymap_US);
  15. keyboard.begin(DataPin, IRQpin, PS2Keymap_German);
  16. //keyboard.begin(DataPin, IRQpin, PS2Keymap_French);
  17. //keyboard.begin(DataPin, IRQpin, PS2Keymap_Spanish);
  18. //keyboard.begin(DataPin, IRQpin, PS2Keymap_Italian);
  19. //keyboard.begin(DataPin, IRQpin, PS2Keymap_UK);
  20. Serial.begin(9600);
  21. Serial.println("International Keyboard Test:");
  22. }
  23. void loop() {
  24. if (keyboard.available()) {
  25. char c = keyboard.read();
  26. Serial.print(c);
  27. }
  28. }