Kompiluje se
[mirrors/Programs.git] / arduino / ps2_keyboard_test2 / ps2_keyboard_test2.ino
CommitLineData
e6e13bcc
TM
1#include <ps2dev.h> // to emulate a PS/2 device
2PS2dev keyboard(19,18); // PS2dev object (3:clock, 2:data)
3unsigned long timecount = 0;
4
5void setup()
6{
7 keyboard.keyboard_init();
8 Serial.begin(9600);
9 pinMode(LED_BUILTIN, OUTPUT);
10}
11
12void loop()
13{
14 //Handle PS2 communication and react to keyboard led change
15 unsigned char leds;
16 if(keyboard.keyboard_handle(&leds)) {
17 //Serial.print('LEDS');
18 //Serial.print(leds, HEX);
19 digitalWrite(LED_BUILTIN, leds);
20 }
21
22 //Print letter every second
23 if((millis() - timecount) > 1000) {
24 keyboard.keyboard_mkbrk(0x16);
25 Serial.print('.');
26 timecount = millis();
27 }
28}
This page took 0.164668 seconds and 4 git commands to generate.