Stap 3: Code
Eerst omvatten deze bibliotheek aan Arduino (Sketch > bestand toevoegen) < PS2Keyboard.h >
<p>#include < PS2Keyboard.h><br>const int DataPin = 8; const int IRQpin = 3; char c; PS2Keyboard keyboard; int led = 9; // the pin that the LED is attached to void setup() { delay(1000); keyboard.begin(DataPin, IRQpin); pinMode(led, OUTPUT); } void loop() { { if (keyboard.available()) { c = keyboard.read()*25; analogWrite(led, c); } }}</p>