Skip to content

Commit b146201

Browse files
committed
RPI: add HardwareSetupRPI
1 parent 30ddd5a commit b146201

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

ArduinoCore-Linux/cores/arduino/Arduino.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
#include "ArduinoAPI.h"
4040
#include "ArdStdio.h"
4141
#include "ArduinoLogger.h"
42-
#include "HardwareSetup.h"
4342
#include "Serial.h"
4443
#include "RemoteSerial.h"
45-
44+
#include "HardwareSetup.h"
45+
#ifdef USE_RPI
46+
# include "HardwareSetupRPI.h"
47+
#endif
4648
using namespace arduino;

ArduinoCore-Linux/cores/rasperry_pi/HardwareSetupRPI.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "HardwareI2C_RPI.h"
66
#include "HardwareSPI_RPI.h"
77

8+
namespace arduino {
9+
810
/**
911
* @class HardwareSetupRPI
1012
* @brief Sets up hardware interfaces for Raspberry Pi (GPIO, I2C, SPI).
@@ -61,4 +63,6 @@ class HardwareSetupRPI {
6163
*/
6264
static HardwareSetupRPI RPI;
6365

66+
} // namespace arduino
67+
6468
#endif

examples/raspberry_pi/blink/blink.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
int LED_BUILTIN = 13; // Define the built-in LED pin (usually pin 13 on Arduino boards)
44

55
void setup() {
6+
Serial.begin(115200); // Start serial communication at 115200 baud
67
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED pin as output
78
}
89

0 commit comments

Comments
 (0)