123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- // defining the hardware connections
- #ifdef __AVR_ATmega328P__
- // Arduino Hardware
- const byte Din_1 = 0;
- const byte Din_2 = 1;
- const byte Din_3 = 2;
- const byte Din_4 = 3;
- const byte Dout_1 = 4;
- const byte Dout_2 = 5;
- const byte Dout_3 = 6;
- const byte Dout_4 = 7;
- const byte ADC_0 = 0; //(15)
- const byte ADC_1 = 1; //(16)
- const byte PWM_1 = 9;
- const byte PWM_2 = 10;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 18;
- const byte RC_1 = 19;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 9;
- const byte SERVO_2 = 10;
- #endif
- const byte SW_PRG = 8;
- const byte SW_SEL = 11;
- #ifdef SPS_USE_DISPLAY
- const byte DIGIT_DATA_IO = 12;
- const byte DIGIT_CLOCK = 13;
- #endif
- #define getAnalog(pin) (analogRead(pin) >> 2)
- #define initHardware()
- #endif
- #ifdef __AVR_ATtiny84__
- // ATTiny84 Hardware
- const byte Dout_1 = 6;
- const byte Dout_2 = 5;
- const byte Dout_3 = 4;
- const byte Dout_4 = 1;
- const byte Din_1 = 10;
- const byte Din_2 = 9;
- const byte Din_3 = 8;
- const byte Din_4 = 7;
- const byte ADC_0 = 0;
- const byte ADC_1 = 1;
- const byte PWM_1 = 2;
- const byte PWM_2 = 3;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 10;
- const byte RC_1 = 9;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 2;
- const byte SERVO_2 = 3;
- #endif
- const byte SW_PRG = 0;
- const byte SW_SEL = 8;
- #ifdef SPS_USE_DISPLAY
- const byte DIGIT_DATA_IO = 4;
- const byte DIGIT_CLOCK = 5;
- #endif
- #define getAnalog(pin) (analogRead(pin) >> 2)
- #define initHardware()
- #endif
- #ifdef __AVR_ATtiny4313__
- // ATTiny4313 Hardware
- const byte Dout_1 = 0;
- const byte Dout_2 = 1;
- const byte Dout_3 = 2;
- const byte Dout_4 = 3;
- const byte Din_1 = 4;
- const byte Din_2 = 5;
- const byte Din_3 = 6;
- const byte Din_4 = 7;
- const byte ADC_0 = 13;
- const byte ADC_1 = 14;
- const byte PWM_1 = 11;
- const byte PWM_2 = 12;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 15;
- const byte RC_1 = 16;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 11;
- const byte SERVO_2 = 12;
- #endif
- const byte SW_PRG = 9;
- const byte SW_SEL = 8;
- #define getAnalog(pin) (analogRead(pin) >> 2)
- #define initHardware()
- #endif
- #ifdef __AVR_ATtiny861__
- // ATTiny4313 Hardware
- const byte Dout_1 = 0;
- const byte Dout_2 = 1;
- const byte Dout_3 = 2;
- const byte Dout_4 = 3;
- const byte Din_1 = 4;
- const byte Din_2 = 5;
- const byte Din_3 = 6;
- const byte Din_4 = 7;
- const byte ADC_0 = 13;
- const byte ADC_1 = 14;
- const byte PWM_1 = 11;
- const byte PWM_2 = 12;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 15;
- const byte RC_1 = 16;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 11;
- const byte SERVO_2 = 12;
- #endif
- const byte SW_PRG = 9;
- const byte SW_SEL = 8;
- #define getAnalog(pin) (analogRead(pin) >> 2)
- #define initHardware()
- #endif
- #ifdef _MICROBIT_V2_
- // Microbit V2 Hardware
- const byte Din_1 = 0;
- const byte Din_2 = 1;
- const byte Din_3 = 2;
- const byte Din_4 = 3;
- const byte Dout_1 = 4;
- const byte Dout_2 = 5;
- const byte Dout_3 = 6;
- const byte Dout_4 = 7;
- const byte ADC_0 = 0; //(15)
- const byte ADC_1 = 1; //(16)
- const byte PWM_1 = 9;
- const byte PWM_2 = 10;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 18;
- const byte RC_1 = 19;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 9;
- const byte SERVO_2 = 10;
- #endif
- const byte SW_PRG = 8;
- const byte SW_SEL = 11;
- #ifdef SPS_USE_DISPLAY
- const byte DIGIT_DATA_IO = 12;
- const byte DIGIT_CLOCK = 13;
- #endif
- #define getAnalog(pin) (analogRead(pin) >> 2)
- #define initHardware()
- #endif
- #ifdef ESP32
- #include "esp32.h"
- // ESP32 Hardware
- const byte Din_1 = 26;
- const byte Din_2 = 18;
- const byte Din_3 = 19;
- const byte Din_4 = 23;
- const byte Dout_1 = 22;
- const byte Dout_2 = 21;
- const byte Dout_3 = 17;
- const byte Dout_4 = 16;
- const byte ADC_0 = 36;
- const byte ADC_1 = 39;
- const byte PWM_1 = 27;
- const byte PWM_2 = 25;
- #ifdef SPS_TONE
- const byte TONE_OUT = PWM_2;
- #endif
- #ifdef SPS_RCRECEIVER
- const byte RC_0 = 34;
- const byte RC_1 = 35;
- #endif
- #ifdef SPS_SERVO
- const byte SERVO_1 = 27; //14
- const byte SERVO_2 = 25; //32
- #endif
- const byte SW_PRG = 13;
- const byte SW_SEL = 12;
- #ifdef SPS_USE_DISPLAY
- const byte DIGIT_DATA_IO = 32;
- const byte DIGIT_CLOCK = 33;
- #endif
- #define getAnalog(pin) (analogRead(pin) >> 4)
- #define initHardware() initESP32()
- #endif
|