From c4ad41b7348e9e56d892297a41803a634f34adee Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 6 May 2014 13:15:26 -0700 Subject: [PATCH] Destroyed ReadMe Arduino (markdown) --- ReadMe-Arduino.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 ReadMe-Arduino.md diff --git a/ReadMe-Arduino.md b/ReadMe-Arduino.md deleted file mode 100644 index 6c8538b..0000000 --- a/ReadMe-Arduino.md +++ /dev/null @@ -1,44 +0,0 @@ -#Arduino -This readme applies to most generic Arduino boards, like the Uno, that connect to the host computer via a USB or Serial port. As a simple way to get started this readme and the nodes referred to require the use of the Firmata sketch that is available in all recent versions of the Arduino software. - -The actual Node-RED flow runs on the host computer and constantly talks to the Firmata on the Arduino to control the pins and so on. As no "app" is downloaded to the Arduino then the host computer must always be there. - -Of course you can use your own sketches and protocols to talk from the Arduino, and Node-RED can help with interfacing those as well. - -##Installation - -First you need to load the default Firmata sketch onto the Arduino using the standard Arduino software download tools. This is usually found under Files - Examples - Firmata - Standard Firmata - -To ensure you have the Arduino nodes in the Node-RED palette - stop Node-RED (if it is running). - - cd node-red - npm install firmata - node red.js - -This install only has to be done once. - -##Blink - -To run a "blink" flow that uses LED 13 import the following flow, by cutting the line below into your clipboard. - - [{"id":"d7663aaf.47194","type":"arduino-board","repeat":"25","device":"/dev/ttyUSB0"},{"id":"8c09ca6c.a975d","type":"arduino out","name":"","pin":"13","state":"OUTPUT","arduino":"d7663aaf.47194","x":509.16667556762695,"y":162.16666984558105,"wires":[]},{"id":"e37b6a97.610968","type":"inject","name":"tick","topic":"","payload":"","repeat":"0.5","once":false,"x":116.16668319702148,"y":62.16666507720947,"wires":[["60b4aeaa.800d58"]]},{"id":"60b4aeaa.800d58","type":"function","name":"Toggle output on input","func":"\n// initialise level as a context variable if currently undefined \n// (context variables persist between calls to the function)\ncontext.level = context.level || false;\n\n// if it's a 0 make it a 1 else make it a 0...\ncontext.level = !context.level;\n\n// set the payload to the level and return\nmsg.payload = context.level;\nreturn msg;","outputs":1,"x":298.1666793823242,"y":113.16665458679199,"wires":[["8c09ca6c.a975d"]]}] - -Then in the Node-RED browser - Use Options (top right) - Import From - Clipboard, or the shortcut Ctrl-i, and paste in the text, Ctrl-v, and select OK. - -You will then probably need to set the serial port. To do this double click the node labelled Pin 13. If the port is not correct - click the pencil icon and correct the port definition as appropriate for your host computer and select OK. If you also need to change the pin to something other than 13 - do so now, and hit OK again. - -Hit Deploy - and the flow should start running. LED 13 should start toggling on and off once a second. - -##Capabilities - -The Arduino output node can currently support three modes of operation, - - - Digital - 0 or 1 - - Analogue - 0 to 255 - - Servo - 0 to 180 - -The Arduino input node, available in the palette but not used in this example can support both Digital and Analogue pins. - -Please note that the input will send a message whenever it detects a change. This may be OK for digital inputs as the tend to be fairly stable, but analogue readings often end up being at the full sample rate, (default 40 times a second...). This can be changed in the configuration of the serial port (under that pencil), to reduce it to a more manageable rate. - -Details of the underlying library can be found here - https://github.com/jgautier/firmata