This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -34,7 +34,7 @@ The way this works is simple (in theory, not in practice). The Arduino listens f
# libraries
##board
##board
````javascript
var board = new arduino.Board({
Expand Down
Expand Up
@@ -73,31 +73,31 @@ board.on('data', function(m){
}
````
###board.serial
###board.serial
Low-level access to the serial connection to the board
###board.write(msg)
###board.write(msg)
Write a message to the board, wrapped in predefined delimiters (! and .)
###board.pinMode(pin, mode)
###board.pinMode(pin, mode)
Set the mode for a pin. `mode` is either `'in'` or `'out'`
###board.digitalWrite(pin, val)
###board.digitalWrite(pin, val)
Write one of the following to a pin:
####board.HIGH and board.LOW
####board.HIGH and board.LOW
Constants for use in low-level digital writes
###board.analogWrite(pin,val)
###board.analogWrite(pin,val)
Write a value between 0-255 to a pin
##led
##led
````javascript
var led = new arduino.Led({
Expand All
@@ -108,27 +108,27 @@ var led = new arduino.Led({
Pin will default to 13.
###led.on()
###led.on()
Turn the LED on
###led.off()
###led.off()
Turn the LED off
###led.blink(interval)
###led.blink(interval)
Blink the LED at `interval` ms. Defaults to 1000
###led.fade(interval)
###led.fade(interval)
Fade the to full brightness then back to minimal brightness in `interval` ms. Defaults to 2000
###led.bright
###led.bright
Current brightness of the LED
##lcd
##lcd
This is a port of the [LiquidCrystal library](http://arduino.cc/en/Reference/LiquidCrystal) into JavaScript. Note that communicating with the LCD requires use of the synchronous `board.delay()` busy loop which will block other node.js events from being processed for several milliseconds at a time. (This could be converted to pause a board-level buffered message queue instead.)
In `options`, the "pins" field can either be an array matching a call to any of the [LiquidCrystal constructors](http://arduino.cc/en/Reference/LiquidCrystalConstructor) or an object with "rs", "rw" (optional), "e" and a 4- or 8-long array of "data" pins. Pins will default to `[12, 11, 5, 4, 3, 2]` if not provided.
These are similar to the methods in the [LiquidCrystal library](http://arduino.cc/en/Reference/LiquidCrystal), however they can take an optional boolean parameter. If true or not provided, the setting is enabled. If false, the setting is disabled. For compatibility `.noDisplay()`, `.noCursor()`, `.noBlink()` and `.noAutoscroll()` methods are provided as well.
###lcd.write(val), lcd.print(val)
###lcd.write(val), lcd.print(val)
These take a buffer, string or integer and send it to the display. The `.write` and `print` methods are equivalent, aliases to the same function.
###lcd.createChar(location, charmap)
###lcd.createChar(location, charmap)
Configures a custom character for code `location` (numbers 0–7). `charmap` can be a 40-byte buffer as in [the C++ method](http://arduino.cc/en/Reference/LiquidCrystalCreateChar), or an array of 5-bit binary strings, or a 40-character string with pixels denoted by any non-space (`' '`) character. These bits determine the 5x8 pixel pattern of the custom character.
Expand Down
Expand Up
@@ -189,7 +189,7 @@ lcd.setCursor(5,2);
lcd.print(new Buffer("\0\1\2\1\0")); // NOTE: when `.print`ing a string, 'ascii' turns \0 into a space
````
##piezo
##piezo
````javascript
var led = new arduino.Piezo({
Expand All
@@ -199,19 +199,19 @@ var led = new arduino.Piezo({
````
Pin will default to 13.
###piezo.note(note, duration)
###piezo.note(note, duration)
Play a pre-calculated note for a given duration (in milliseconds).
`note` must be a string, one of `d`, `e`, `f`, `g`, `a`, `b`, or `c` (must be lowercase)
###piezo.tone(tone, duration)
###piezo.tone(tone, duration)
Write a square wave to the piezo element.
`tone` and `duration` must be integers. See code comments for math on `tone` generation.
##button
##button
````javascript
var button = new arduino.Button({
Expand All
@@ -234,7 +234,7 @@ setInterval(function(){
}, 1000);
````
##ping
##ping
See: <http://arduino.cc/en/Tutorial/Ping>
Expand All
@@ -248,7 +248,7 @@ range.on('read', function () {
});
````
##servo
##servo
````javascript
var servo = new arduino.Servo({
Expand All
@@ -260,17 +260,17 @@ servo.write(180);
````
Pin will default to 9. (Arduino PWM default)
###servo.sweep()
###servo.sweep()
Increment position from 0 to 180.
###servo.write(pos)
###servo.write(pos)
Instruct the servo to immediately go to a position from 0 to 180.
##motor
##motor
##potentiometer
##potentiometer
# protocol
Expand All
@@ -288,7 +288,7 @@ A full message looks like this:
I was drunk. It works.
##command
##command
What is implemented right now:
Expand All
@@ -301,11 +301,11 @@ What is implemented right now:
* `98` servo
* `99` debug
##pin
##pin
Pins can be sent as an integer or a string(`1`, `2`, `"3"`, `"A0"`)
##value
##value
* `board.LOW`(`0`)
* `board.HIGH`(`255`)
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix broken headings in Markdown files #61
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Fix broken headings in Markdown files #61
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing