Difference between revisions of "Physical Controllers"
Line 43: | Line 43: | ||
Available as a kit too: |
Available as a kit too: |
||
− | [[File:MicrophoneSensor.jpg|thumb|Microphone |
+ | [[File:MicrophoneSensor.jpg|thumb|EGC Microphone Sensor Kit]] |
On a breadboard: |
On a breadboard: |
Revision as of 11:23, 28 June 2023
Hand holding sensor
Measure the voltage - could be a chain of humans that hold hands, Arduino measure the voltage and smoothes it out with a capacitor. The LED is just to show the difference in voltage:
The Arduino connects to 5Volts, Ground and Analog 0
The Breadboard, purple wires are for holding in your hands. Capacitor to smooth out the voltage.
The code
RFID Tag Reader
Can be used to read RFID Cards/ or write to them. Uses a ~3 Dollar RFID Reader (RC522) Worked best with Arduino Uno.
The Code: File:Rfid.zip
Stepper Motor
Using a A4988 Stepper Motor Driver, Arduino and a Stepper Motor from StepperOnline ( Nema 17 Bipolar 42Ncm 1.5A ). Setup the Driver as in this diagram File:POLOLU-2128.pdf, using this video tutorial: https://www.youtube.com/watch?v=psI3aN0A-OA Be sure to use a capacitor to avoid electricity to leak back into the Arduino and make sure to set the current limit on the Driver as described in the stepper driver document. For me it was 0.6v as I wanted a maximum of 1.5 A of current through the Stepper. Arduino code was here: File:StepperCode.zip
Microphone Sensor
Using a Raspberry Pi Pico with Micropython - Takes a Microphone input and then outputs a gradient on LEDs. This could be of course also be used for a sound sensing controller - move the player only when you make a sound or so.
Available as a kit too:
SEEDUINO XIAO
A super small Arduino/Micropython device. About 15 Euros.
Connecting it to Arduino IDE: https://wiki.seeedstudio.com/Seeed_Arduino_Boards/
Unfortunately did not work the first time I used it, may just have been a faulty device..
Reading Serial Data in Unity
In order to read data from Arduino to Unity, you can simply print out text to the Serial port. Then receive this in Unity with this script:
Important that the Serial Monitor is not open when trying to read. May require plugging in/out the USB sometimes. Also, you need to set the correct Port (COM + Number).