Hello! Because I find the Sprig looks like a game controller, I wanted use it as one!
![Game Controllers](https://private-user-images.githubusercontent.com/181651233/404555837-2b5e54a5-905c-4256-b7b9-04d01e1272a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjI4MjQsIm5iZiI6MTczODk2MjUyNCwicGF0aCI6Ii8xODE2NTEyMzMvNDA0NTU1ODM3LTJiNWU1NGE1LTkwNWMtNDI1Ni1iN2I5LTA0ZDAxZTEyNzJhNi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QyMTA4NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kZTcwNDc1ZjkwOWU5Yzc1YTRmYjI2MzIwM2NlODQ1MzRjNTRkYTM4ZTFmZWQwODllYzJhM2U1MTQ4MDRhMWNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.00tyzeSPUi3JOBu1St6ncNEn29S_IUvX9BtKIuQ03PU)
Disclaimer: Sadly, there is quite a lot of latency between pressing a key and it arriving at your PC. So although I really wanted to use it to play video games, it won't work for anything that requires precise timing. Or a mouse.
To make this work, you need to have a Sprig and a PC. Alternatively, you can build your own console from a Raspberry Pi Pico W and some buttons :)
First, if you haven't already, you need to install Python and Thonny
Then, install micropython on your Raspberry Pi Pico W (The board on the back of your Sprig):
Manipulate my files:
- Download the files from this repsitory
- Fill out the credentials.py file
- Then, upload the files console_pico.py and credentials.py to your Pico
- Rename the console_pico.py file to main.py. This causes the program to run on your Pico as soon as it has power.
Before running the program,
- Make sure your PC is connected to your network,
- And that the credentials.py file is identical on both devices.
Then:
- Run the console.py file
- Turn on your Sprig
- Wait for the little green LED on the back of your Sprig to turn on, indicating it has connected to your network
Voilà! That should allow you to send keypresses over your WiFi network, and use your Sprig as a console/keyboard!
Disclaimer (again): Sadly, there is quite a lot of latency between pressing a key and it arriving at your PC. So although I really wanted to use it to play video games, it won't work for anything that requires precise timing. Or a mouse.