77ay
77ay

Reputation: 13

How to edit library to use with Arduino DUE?

I want to add Arduino DUE in this code.

// Arduino Uno, Duemilanove, LilyPad, etc
//
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
 #define ALTSS_USE_TIMER1
 #define INPUT_CAPTURE_PIN       8 // receive
 #define OUTPUT_COMPARE_A_PIN        9 // transmit
 #define OUTPUT_COMPARE_B_PIN       10 // unusable PWM

Code from library

Upvotes: 1

Views: 235

Answers (1)

Kanish
Kanish

Reputation: 546

The preprocessor for the Arduino Due is __SAM3X8E__. For example:

// Arduino Uno, Duemilanove, LilyPad, etc
//
#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__)
 #define ALTSS_USE_TIMER1
 #define INPUT_CAPTURE_PIN       8 // receive
 #define OUTPUT_COMPARE_A_PIN        9 // transmit
 #define OUTPUT_COMPARE_B_PIN       10 // unusable PWM
//
// Arduino Due
// 
#elif defined(__SAM3X8E__)
// define or do your stuff

Upvotes: 1

Related Questions