Skip to content

Commit

Permalink
Fixed pin settings for Leonardo board and Blend Micro board.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheong2K committed Apr 29, 2014
1 parent b5cf4f0 commit ff34f18
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,31 @@ writePort(port, value, bitmask): Write an 8 bit port.
#define PIN_TO_SERVO(p) (p)


// Blend Micro
#elif defined(BLEND_MICRO)
#define TOTAL_ANALOG_PINS 6
#define TOTAL_PINS 24 // 11 digital + 12 analog
#define VERSION_BLINK_PIN 13
#define IS_PIN_DIGITAL(p) ( (p) >= 0 && (p) < 24 && !((p) == 4) && !((p) >= 6 && (p) <= 7) && !((p) >=14 && (p) <= 17) )
#define IS_PIN_ANALOG(p) ((p) >= 18 && (p) < 24)
#define IS_PIN_PWM(p) ( (p) == 3 || (p) == 5 || (p) == 9 || (p) == 10 || (p) == 11 || (p) == 13 )
#define IS_PIN_SERVO(p) ( (p) >= 0 && (p) < MAX_SERVOS && !((p) == 4) && !((p) >= 6 && (p) <= 7) )
#define IS_PIN_I2C(p) ((p) == 5 || (p) == 6)
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) ((p)-18)
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p) (p)


// Teensy 2.0
#elif defined(__AVR_ATmega32U4__)
#define TOTAL_ANALOG_PINS 6
#define TOTAL_PINS 24 // 11 digital + 12 analog
#define VERSION_BLINK_PIN 13
#define IS_PIN_DIGITAL(p) ((p) >= 0 && (p) < 24 && !((p) >=14 && (p) <= 17))
#define IS_PIN_DIGITAL(p) ( (p) >= 0 && (p) < 24 && !((p) >= 8 && (p) <= 9) && !((p) >=14 && (p) <= 17) )
#define IS_PIN_ANALOG(p) ((p) >= 18 && (p) < 24)
#define IS_PIN_PWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11 || (p) == 13)
#define IS_PIN_SERVO(p) ((p) >= 0 && (p) < MAX_SERVOS)
#define IS_PIN_PWM(p) ( (p) == 3 || (p) == 5 || (p) == 6 || (p) == 10 || (p) == 11 || (p) == 13 )
#define IS_PIN_SERVO(p) ( (p) >= 0 && (p) < MAX_SERVOS && !((p) >= 8 && (p) <= 9) )
#define IS_PIN_I2C(p) ((p) == 5 || (p) == 6)
#define PIN_TO_DIGITAL(p) (p)
#define PIN_TO_ANALOG(p) ((p)-18)
Expand Down Expand Up @@ -380,4 +396,3 @@ static inline unsigned char writePort(byte port, byte value, byte bitmask)


#endif /* Firmata_Boards_h */

0 comments on commit ff34f18

Please sign in to comment.