Paso 5: Cómo detectar EMF.
Es necesario:
Varios pies de alambre.
resistencia de 3.3meg ohmios.
--------------------------------------------------------------------------------------
Código de ejemplo:
pseudo código:
getmagdata:
r = STICK(1)
maglevel = r
Imprimir "maglevel (0-255) es:"; maglevel
Si maglevel > algunos valor entonces Imprimir "PELIGRO ADVERTENCIA, magnética"
dangerflag = 1
...
...
VOLVER
--------------------------------------------------------------------------------------
Joystick B ____ Joystick A / | / | / | / 1 | | O------- 5 Volt 5 Volt -------O | | 9 2 | | O------- Button 1 Button 3 -------O | | 10 3 | | O------- Resistor X-axis (joystick(1)) Resistor X-axis -------O | (joystick(2)) | 11 4 | | O------- Ground MIDI TXD -------O | | 12 5 | | O------- Ground Resistor Y-axis -------O | (joystick(2)) | 13 6 | | O------- Resistor Y-axis (joystick(1)) Button 6 -------O | | 14 7 | | O------- Button 2 MIDI RXD -------O | | 15 8 | | O------- 5 Volt \ | \ | \ | \ | \__| Digital pin 2 = Button 1 = Strig(0) pin 7 = Button 2 = Strig(1) pin 10 = Button 3 = Strig(2) pin 14 = Button 4 = Strig(3) Analog pin 3 = Resistor = Stick(0) pin 6 = Resistor = Stick(1) pin 11 = Resistor = Stick(2) pin 13 = Resistor = Stick(3)