This is a demo project for the Pmod JSTK2 made by Digilent. The X axis and Y axis values of the joystick position are measured and displayed on the Serial monitor with option to normalize these values (standard: ranges from 0 to 1023 - normalized: ranges from -1 to +1). To control the Pmod, an Arduino UNO is used, which also sends the data to the computer. To communicate with the peripheral device, SPI communication protocol is used, in mode 0, with a serial clock frequency between 1MHz and 4MHz. Data is send in 5 bytes: X_LSB, X_MSB (10-bit value with 6 leading zeros), Y_LSB, Y_MSB (10-bit value with 6 leading zeros) abd button state (the last two bits mark the two buttons). The RGB LED state is also controlled with SPI protocol by sending first the address of the LED (0x84) followed by the duty cycle for red, green and blue colors. The LED will stay lit for a few seconds after a button is pressed (the color depends on which button was pressed).
Using the Pmod JSTK2 with Arduino Uno
Application notes for Pmod JSTK2 and Arduino Uno. The X & Y values are displayed in the serial monitor, lighting LEDs using buttons.
BeginnerShowcase (no instructions)1 hour930
Thanks to Lextronics.