Difference between revisions of "Physical Controllers"
Jump to navigation
Jump to search
Line 37: | Line 37: | ||
''' |
''' |
||
+ | |||
+ | |||
+ | == SEEDUINO XIAO == |
||
+ | |||
+ | A super small Arduino/Micropython device. About 15 Euros. |
Revision as of 11:55, 7 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
void setup() {
// initialize serial communication at 9600 bits per second: Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// read the input on analog pin 0: int sensorValue = analogRead(A0); // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): float voltage = sensorValue * (5.0 / 1023.0); // print out the value you read: Serial.println(voltage); digitalWrite(LED_BUILTIN, HIGH); delay(voltage * 10); digitalWrite(LED_BUILTIN, LOW); delay(voltage * 10);
}
SEEDUINO XIAO
A super small Arduino/Micropython device. About 15 Euros.