Skip to content

Adds support for Arduino Due and Teensy 3.0 boards #58

New issue

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

Merged
merged 4 commits into from
May 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,22 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define PIN_TO_SERVO(p) ((p) - 2)


// Arduino DUE
#elif defined(__SAM3X8E__)
#define TOTAL_ANALOG_PINS 12
#define TOTAL_PINS 66 // 54 digital + 12 analog
#define VERSION_BLINK_PIN 13
#define IS_PIN_DIGITAL(p) ((p) >= 2 && (p) < TOTAL_PINS)
#define IS_PIN_ANALOG(p) ((p) >= 54 && (p) < TOTAL_PINS)
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
#define IS_PIN_SERVO(p) ((p) >= 2 && (p) - 2 < MAX_SERVOS)
#define IS_PIN_I2C(p) ((p) == 20 || (p) == 21) // 70 71
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) ((p) - 54)
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p) ((p) - 2)


// Teensy 1.0
#elif defined(__AVR_AT90USB162__)
#define TOTAL_ANALOG_PINS 0
Expand Down Expand Up @@ -234,6 +250,22 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define PIN_TO_SERVO(p) (p)


// Teensy 3.0
#elif defined(__MK20DX128__)
#define TOTAL_ANALOG_PINS 14
#define TOTAL_PINS 38 // 24 digital + 10 analog-digital + 4 analog
#define VERSION_BLINK_PIN 13
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) <= 34)
#define IS_PIN_ANALOG(p) (((p) >= 14 && (p) <= 23) || ((p) >= 34 && (p) <= 38))
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
#define IS_PIN_SERVO(p) ((p) >= 0 && (p) < MAX_SERVOS)
#define IS_PIN_I2C(p) ((p) == 18 || (p) == 19)
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) (((p)<=23)?(p)-14:(p)-24)
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p) (p)


// Teensy++ 1.0 and 2.0
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
#define TOTAL_ANALOG_PINS 8
Expand Down
45 changes: 34 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ Most of the time you will be interacting with arduino with a client library on t

Note: The above libraries may support various versions of the Firmata protocol and therefore may not support all features of the latest Firmata spec nor all arduino and arduino-compatible boards. Refer to the respective projects for details.

##Updating Firmata in the Arduino IDE
##Updating Firmata in the Arduino IDE (< Arduino 1.5)
The version of firmata in the Arduino IDE contains an outdated version of Firmata. To update Firmata, clone the repo into the location of firmata in the arduino IDE or download the latest [tagged version](https://github.com/firmata/arduino/tags) (stable), rename the folder to "Firmata" and replace the existing Firmata folder in your Ardino application.

**Mac OSX**:

```
rm -r /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
git clone [email protected]:firmata/arduino.git /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
```bash
$ rm -r /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
$ git clone [email protected]:firmata/arduino.git /Applications/Arduino.app/Contents/Resources/Java/libraries/Firmata
```

If you are downloading the latest tagged version of Firmata, rename it to "Firmata" and copy to /Applications/Arduino.app/Contents/Resources/Java/libraries/ overwriting the existing Firmata directory. Right-click (or conrol + click) on the Arduino application and choose "Show Package Contents" and navigate to the libraries directory.
Expand All @@ -58,20 +58,43 @@ If you are downloading the latest tagged version of Firmata, rename it to "Firma

Using the Git Shell application installed with [GitHub for Windows](http://windows.github.com/) (set default shell in options to Git Bash) or other command line based git tool:

```
# update the path and arduino version as necessary
rm -r c:/Program\ Files/arduino-1.x/libraries/Firmata
git clone [email protected]:firmata/arduino.git c:/Program\ Files/arduino-1.x/libraries/Firmata
update the path and arduino version as necessary
```bash
$ rm -r c:/Program\ Files/arduino-1.x/libraries/Firmata
$ git clone [email protected]:firmata/arduino.git c:/Program\ Files/arduino-1.x/libraries/Firmata
```

Note: If you use GitHub for Windows, you must clone the firmata/arduino repository using the Git Shell application as described above. You can use the Github for Windows GUI only after you have cloned the repository. Drag the Firmata file into the Github for Windows GUI to track it.

**Linux**:

update the path and arduino version as necessary
```bash
$ rm -r ~/arduino-1.x/libraries/Firmata
$ git clone [email protected]:firmata/arduino.git ~/arduino-1.x/libraries/Firmata
```

##Updating Firmata in the Arduino IDE (>= Arduino 1.5.2)
As of Arduino 1.5.2 and there are separate library directories for the sam and
avr architectures. To update Firmata in Arduino 1.5.2 or higher, follow the
instructions above for pre Arduino 1.5 versions but update the path as follows:

**Mac OSX**:
```
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/Firmata
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/sam/libraries/Firmata
```

**Windows**:
```
/Program\ Files/arduino-1.5.x/hardware/arduino/avr/libraries/Firmata
/Program\ Files/arduino-1.5.x/hardware/arduino/sam/libraries/Firmata
```

**Linux**
```
# update the path and arduino version as necessary
rm -r ~/arduino-1.x/libraries/Firmata
git clone [email protected]:firmata/arduino.git ~/arduino-1.x/libraries/Firmata
~/arduino-1.5.x/hardware/arduino/avr/libraries/Firmata
~/arduino-1.5.x/hardware/arduino/sam/libraries/Firmata
```

<a name="contributing" />
Expand Down