Skip to content

Commit d841661

Browse files
committed
Updating to revision 25 of firmata (slightly post version 2.1beta2).
1 parent 3f5220e commit d841661

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

libraries/Firmata/Firmata.h

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
* installed firmware. */
2424
#define FIRMATA_MAJOR_VERSION 2 // for non-compatible changes
2525
#define FIRMATA_MINOR_VERSION 1 // for backwards compatible changes
26-
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
2726

2827
#define MAX_DATA_BYTES 32 // max number of data bytes in non-Sysex messages
2928

@@ -157,26 +156,71 @@ extern FirmataClass Firmata;
157156
#define TOTAL_DIGITAL_PINS 22 // 14 digital + 8 analog
158157
#define TOTAL_PORTS 3 // total number of ports for the board
159158
#define ANALOG_PORT 2 // port# of analog used as digital
159+
#define FIRST_ANALOG_PIN 14 // pin# corresponding to analog 0
160+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
160161
#elif defined(__AVR_ATmega8__) // old Arduinos
161162
#define TOTAL_ANALOG_PINS 6
162163
#define TOTAL_DIGITAL_PINS 20 // 14 digital + 6 analog
163164
#define TOTAL_PORTS 3 // total number of ports for the board
164165
#define ANALOG_PORT 2 // port# of analog used as digital
166+
#define FIRST_ANALOG_PIN 14 // pin# corresponding to analog 0
167+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
165168
#elif defined(__AVR_ATmega1280__)// Arduino Mega
166169
#define TOTAL_ANALOG_PINS 16
167-
#define TOTAL_DIGITAL_PINS 54
168-
#define TOTAL_PORTS 8 // total number of ports for the board
169-
#define ANALOG_PORT 2 // port# of analog used as digital
170+
#define TOTAL_DIGITAL_PINS 70 // 54 digital + 16 analog
171+
#define TOTAL_PORTS 9 // total number of ports for the board
172+
#define ANALOG_PORT 8 // port# of analog used as digital
173+
#define FIRST_ANALOG_PIN 54 // pin# corresponding to analog 0
174+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
170175
#elif defined(__AVR_ATmega128__)// Wiring
171176
#define TOTAL_ANALOG_PINS 8
172177
#define TOTAL_DIGITAL_PINS 51
178+
#define TOTAL_PORTS 7 // total number of ports for the board
179+
#define ANALOG_PORT 5 // port# of analog used as digital
180+
#define FIRST_ANALOG_PIN 40 // pin# corresponding to analog 0
181+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
182+
#elif defined(__AVR_AT90USB162__) // Teensy
183+
#define TOTAL_ANALOG_PINS 0
184+
#define TOTAL_DIGITAL_PINS 21 // 21 digital + no analog
185+
#define TOTAL_PORTS 4 // total number of ports for the board
186+
#define ANALOG_PORT 3 // port# of analog used as digital
187+
#define FIRST_ANALOG_PIN 21 // pin# corresponding to analog 0
188+
#define VERSION_BLINK_PIN 6 // digital pin to blink version on
189+
#elif defined(__AVR_ATmega32U4__) // Teensy
190+
#define TOTAL_ANALOG_PINS 12
191+
#define TOTAL_DIGITAL_PINS 25 // 11 digital + 12 analog
192+
#define TOTAL_PORTS 4 // total number of ports for the board
193+
#define ANALOG_PORT 3 // port# of analog used as digital
194+
#define FIRST_ANALOG_PIN 11 // pin# corresponding to analog 0
195+
#define VERSION_BLINK_PIN 11 // digital pin to blink version on
196+
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) // Teensy++
197+
#define TOTAL_ANALOG_PINS 8
198+
#define TOTAL_DIGITAL_PINS 46 // 38 digital + 8 analog
173199
#define TOTAL_PORTS 6 // total number of ports for the board
174-
#define ANALOG_PORT 2 // port# of analog used as digital
200+
#define ANALOG_PORT 5 // port# of analog used as digital
201+
#define FIRST_ANALOG_PIN 38 // pin# corresponding to analog 0
202+
#define VERSION_BLINK_PIN 6 // digital pin to blink version on
203+
#elif defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644__) // Sanguino
204+
#define TOTAL_ANALOG_PINS 8
205+
#define TOTAL_DIGITAL_PINS 32 // 24 digital + 8 analog
206+
#define TOTAL_PORTS 4 // total number of ports for the board
207+
#define ANALOG_PORT 3 // port# of analog used as digital
208+
#define FIRST_ANALOG_PIN 24 // pin# corresponding to analog 0
209+
#define VERSION_BLINK_PIN 0 // digital pin to blink version on
210+
#elif defined(__AVR_ATmega645__) // Illuminato
211+
#define TOTAL_ANALOG_PINS 6
212+
#define TOTAL_DIGITAL_PINS 42 // 36 digital + 6 analog
213+
#define TOTAL_PORTS 6 // total number of ports for the board
214+
#define ANALOG_PORT 4 // port# of analog used as digital
215+
#define FIRST_ANALOG_PIN 36 // pin# corresponding to analog 0
216+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
175217
#else // anything else
176218
#define TOTAL_ANALOG_PINS 6
177219
#define TOTAL_DIGITAL_PINS 14
178220
#define TOTAL_PORTS 3 // total number of ports for the board
179221
#define ANALOG_PORT 2 // port# of analog used as digital
222+
#define FIRST_ANALOG_PIN 14 // pin# corresponding to analog 0
223+
#define VERSION_BLINK_PIN 13 // digital pin to blink version on
180224
#endif
181225

182226

libraries/Firmata/examples/I2CFirmata/I2CFirmata.pde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void sysexCallback(byte command, byte argc, byte *argv)
149149
delayTime = (delayTime << 8) + (argv[2] + (argv[3] << 7)); // add LSB
150150

151151
if((argv[0] + (argv[1] << 7)) > 0) {
152-
enablePowerPins(PC3, PC2);
152+
enablePowerPins(PORTC3, PORTC2);
153153
}
154154

155155
if(delayTime > 0) {

0 commit comments

Comments
 (0)