Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jgautier/firmata
Browse files Browse the repository at this point in the history
  • Loading branch information
jgautier committed Jun 7, 2011
2 parents d452ee3 + 46f5c29 commit fd53d7e
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ If you run *firmata* from the command line it will prompt you for the usb port.
SERVO:0x04
}
This is an enumeration of the different modes available. This are used in calls to the *pinMode* function.

*Board.HIGH* and *Board.LOW*

These are constants used to set a digital pin low or high. Used in calls to the *digitalWrite* function.

*Board.pins*

This is an array of all the pins on the arduino board.

Each value in the array is an object:

{
Expand All @@ -37,20 +42,32 @@ If you run *firmata* from the command line it will prompt you for the usb port.
,supportedModes://an array of modes from board.MODES that are supported on this pin.
,analogChannel://will be 127 for digital pins and the pin number for analog pins.
}

This array holds all pins digital and analog. To get the analog pin number as seen on the arduino board use the analogChannel attribute.

*Board.analogPins*

This is an array of all the array indexes of the analog pins in the *Board.pins* array.
For example to get the analog pin 5 from the *Board.pins* attributes use:

board.pins[board.analogPins[5]];
#methods
*board.pinMode(pin,mode)*
Set a mode for a pin. pin is the number of the pin and the mode is on of the Board.MODES values.
*board.digitalWrite(pin,value)*
Write an output to a digital pin. pin is the number of the pin and the value is either board.HIGH or board.LOW.
*board.digitalRead(pin,callback)*
Read a digital value from the pin. Evertime there is data for the pin the callback will be fired with a value argument.
*board.analogWrite(pin,value)*
Write an output to a digital pin. pin is the number of the pin and the value is between 0 and 255.
*board.analogRead(pin,callback)*
Read an input for an analog pin. Every time there is data on the pin the callback will be fired with a value argument.
##methods
*board.pinMode(pin,mode)*

Set a mode for a pin. pin is the number of the pin and the mode is on of the Board.MODES values.

*board.digitalWrite(pin,value)*

Write an output to a digital pin. pin is the number of the pin and the value is either board.HGH or board.LOW.

*board.digitalRead(pin,callback)*

Read a digital value from the pin. Evertime there is data for the pin the callback will be fired with a value argument.

*board.analogWrite(pin,value)*

Write an output to a digital pin. pin is the number of the pin and the value is between 0 and 255.

*board.analogRead(pin,callback)*

Read an input for an analog pin. Every time there is data on the pin the callback will be fired with a value argument.

0 comments on commit fd53d7e

Please sign in to comment.