Replies: 4 comments 18 replies
-
Good Morning @sstaub ☕ 👋 Why do you think so? (This not meant to discourage the contribution, but rather an invitation to hear your reasons why you believe such an API should exist.) |
Beta Was this translation helpful? Give feedback.
-
You really want to start a basic discussion of pro and cons of OOP? |
Beta Was this translation helpful? Give feedback.
-
A C++ API makes code more readable, also avoiding pre processor directives for identification. #define LED1 LED_BUILTIN
void setup() {
pinMode(LED1, OUTPUT);
}
void loop() {
digitalWrite(LED1, HIGH);
delay(1000);
digitalWrite(LED1, LOW);
delay(1000);
} or more elegant: Digital led1(LED_BUILTIN, OUTPUT);
void setup() {
}
void loop() {
led1.write(HIGH);
delay(1000);
led1.write(LOW);
delay(1000);
} |
Beta Was this translation helpful? Give feedback.
-
I know mbed and I worked with it for while, this is one of the reasons. The idea was also a part of Wring++ which was never released. The OOP API is thought as an extension not at replacement. |
Beta Was this translation helpful? Give feedback.
-
There should exist a c++ object orientated API for Digital, Analog , SPI, I2C, UART...
e.g. for GPIO
Beta Was this translation helpful? Give feedback.
All reactions