【问题标题】:How to edit library to use with Arduino DUE?如何编辑库以与 Arduino DUE 一起使用?
【发布时间】:2019-04-22 18:09:16
【问题描述】:

我想在这段代码中添加 Arduino DUE。

// 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 arduino-due


    【解决方案1】:

    Arduino Due 的预处理器是__SAM3X8E__。例如:

    // 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
    

    【讨论】:

      猜你喜欢
      • 2015-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-26
      • 1970-01-01
      • 2021-03-10
      • 1970-01-01
      相关资源
      最近更新 更多