Javascript Coding with FunKey sensors and outputs
1. Make sure FunKey is in Programming Mode.
Special configured Arduino boards are shipped in this mode or connect G/M and plug in the FunKey.
2. Add sensors and outputs to the ports
3. Using Chrome, go to the links below. An editor will launch with examples. You can edit the examples, and load and save code files from your computer.
Here's an example that uses a sensor to change a value in Javascript. Connect a potentiometer to port A0 (M) then click on this link. The code will appear in an editor. Click "run code" to run. You can also upload or download javascript files you have made, stored on your computer.
https://www.elasticmind.com/JSDuino/index.html?file=sensorToRectangle.js
Here's another example that uses a sensors and outputs with comments in the code.
https://www.elasticmind.com/JSDuino/index.html?file=sensorsAndActuators.js
Here's another example that uses a servo motor controlled by a potentiometer. The servo is connected to port D0 (G) and the potentiometer is connected to port A0 (M)
https://www.elasticmind.com/JSDuino/index.html?file=servo.js
Heartbeat recorder example: The heartbeat sensor is connected to port A0(M). Place the sensor on your skin, give it a while to stabilize and you should see dips in the graph when your heartbeat is detected. Try different areas on your palm, fingertip or cheek.
https://www.elasticmind.com/JSDuino/index.html?file=heartbeatRecorder.js
Theremin: sensor on port A0 controls the frequency of sound
Make SURE you have potentiometers connected to A0 and A1
https://www.elasticmind.com/JSDuino/index.html?file=theremin.js
Potentiometers control the frequency of sound of two inputs
https://www.elasticmind.com/JSDuino/index.html?file=dualOscillator.js
Control the light level of an LED using "pwm" on port 3, 5, 6 or 13