Skip to content

Commit 76909d9

Browse files
committed
Add analouge pin definitions
1 parent 4c4def9 commit 76909d9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cpp/arduino/ArduinoDefines.h

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <stdint.h>
34
#include <avr/pgmspace.h>
45

56
#define HIGH 0x1
@@ -91,4 +92,23 @@
9192

9293
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
9394
#define LED_BUILTIN 13
95+
96+
#define PIN_A0 (14)
97+
#define PIN_A1 (15)
98+
#define PIN_A2 (16)
99+
#define PIN_A3 (17)
100+
#define PIN_A4 (18)
101+
#define PIN_A5 (19)
102+
#define PIN_A6 (20)
103+
#define PIN_A7 (21)
104+
105+
constexpr uint8_t A0 = PIN_A0;
106+
constexpr uint8_t A1 = PIN_A1;
107+
constexpr uint8_t A2 = PIN_A2;
108+
constexpr uint8_t A3 = PIN_A3;
109+
constexpr uint8_t A4 = PIN_A4;
110+
constexpr uint8_t A5 = PIN_A5;
111+
constexpr uint8_t A6 = PIN_A6;
112+
constexpr uint8_t A7 = PIN_A7;
113+
94114
#endif

0 commit comments

Comments
 (0)