Skip to content

Commit 834788d

Browse files
Added Leonardo to Boards.h. Changed example files from .pde to .ino extension. Added link johnny-five javascript client in the readme file. Increased bugfix version number to 2.
1 parent 7f93077 commit 834788d

File tree

12 files changed

+20
-4
lines changed

12 files changed

+20
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Boards.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ writePort(port, value, bitmask): Write an 8 bit port.
214214

215215

216216
// Teensy 2.0
217-
#elif defined(__AVR_ATmega32U4__)
217+
#elif defined(__AVR_ATmega32U4__) && defined(CORE_TEENSY)
218218
#define TOTAL_ANALOG_PINS 12
219219
#define TOTAL_PINS 25 // 11 digital + 12 analog
220220
#define VERSION_BLINK_PIN 11
@@ -245,6 +245,22 @@ writePort(port, value, bitmask): Write an 8 bit port.
245245
#define PIN_TO_SERVO(p) (p)
246246

247247

248+
// Leonardo
249+
#elif defined(__AVR_ATmega32U4__)
250+
#define TOTAL_ANALOG_PINS 12
251+
#define TOTAL_PINS 30 // 14 digital + 12 analog + 4 SPI (D14-D17 on ISP header)
252+
#define VERSION_BLINK_PIN 13
253+
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) < TOTAL_PINS)
254+
#define IS_PIN_ANALOG(p) ((p) >= 18 && (p) < TOTAL_PINS)
255+
#define IS_PIN_PWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11 || (p) == 13)
256+
#define IS_PIN_SERVO(p) ((p) >= 0 && (p) < MAX_SERVOS)
257+
#define IS_PIN_I2C(p) ((p) == 2 || (p) == 3)
258+
#define PIN_TO_DIGITAL(p) (p)
259+
#define PIN_TO_ANALOG(p) (p) - 18
260+
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
261+
#define PIN_TO_SERVO(p) (p)
262+
263+
248264
// Sanguino
249265
#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__)
250266
#define TOTAL_ANALOG_PINS 8

Firmata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* installed firmware. */
2222
#define FIRMATA_MAJOR_VERSION 2 // for non-compatible changes
2323
#define FIRMATA_MINOR_VERSION 3 // for backwards compatible changes
24-
#define FIRMATA_BUGFIX_VERSION 1 // for bugfix releases
24+
#define FIRMATA_BUGFIX_VERSION 2 // for bugfix releases
2525

2626
#define MAX_DATA_BYTES 32 // max number of data bytes in non-Sysex messages
2727

examples/EchoString/EchoString.pde renamed to examples/EchoString/EchoString.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
#include <Firmata.h>
1717

18-
byte analogPin;
19-
2018
void stringCallback(char *myString)
2119
{
2220
Firmata.sendString(myString);

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Most of the time you will be interacting with arduino with a client library on t
2929
* javascript
3030
* [https://github.com/jgautier/firmata]
3131
* [http://breakoutjs.com]
32+
* [https://github.com/rwldrn/johnny-five]
3233
* java
3334
* [https://github.com/4ntoine/Firmata]
3435
* [https://github.com/shigeodayo/Javarduino]

0 commit comments

Comments
 (0)