Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code for reading the PS2 remote controller via SPI.

AVR Atmega328P, 16 MHz, internal SPI.
SPI freqency 250 kHz, mode 0, LSB first. Pins used: MOSI, MISO, SS, SCK.
After spiInit() and remoteInit() functions execution, it is possible to use remoteGetButtonsState() and remoteGetSticksState() functions. First one returns 16-bit uint16_t variable, each bit is button state: 1 - pressed, 0 - released; second one returns 4 bytes uint8_t array pointer: 0 byte is left ctick horizontal position (0 - left, 128 - middle, 255 - right), 1-st byte is left ctick vertical position (0 - down, 128 - middle, 255 - top), 2-nd and 3-rd is for right stick.
Buttons position in 16-bit variable is described in ps2Remote.h file
uartInit() is set for 19200 baud and requires uartInit() function execution first.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages