Skip to content

Commit 50db65d

Browse files
committed
Add LED_BUILTIN
1 parent a5825ef commit 50db65d

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

examples/VL53L3CX_Sat_HelloWorld/VL53L3CX_Sat_HelloWorld.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
#define DEV_I2C Wire
6262
#define SerialPort Serial
6363

64+
#ifndef LED_BUILTIN
65+
#define LED_BUILTIN 13
66+
#endif
67+
#define LedPin LED_BUILTIN
68+
6469
// Components.
6570
VL53LX *sensor_vl53lx_sat;
6671

@@ -70,7 +75,7 @@ VL53LX *sensor_vl53lx_sat;
7075
void setup()
7176
{
7277
// Led.
73-
pinMode(13, OUTPUT);
78+
pinMode(LedPin, OUTPUT);
7479

7580
// Initialize serial for output.
7681
SerialPort.begin(115200);
@@ -107,7 +112,7 @@ void loop()
107112
} while (!NewDataReady);
108113

109114
//Led on
110-
digitalWrite(13, HIGH);
115+
digitalWrite(LedPin, HIGH);
111116

112117
if((!status)&&(NewDataReady!=0))
113118
{
@@ -136,5 +141,5 @@ void loop()
136141
}
137142
}
138143

139-
digitalWrite(13, LOW);
144+
digitalWrite(LedPin, LOW);
140145
}

examples/VL53L3CX_Sat_HelloWorld_Interrupt/VL53L3CX_Sat_HelloWorld_Interrupt.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
#define DEV_I2C Wire
6767
#define SerialPort Serial
6868

69+
#ifndef LED_BUILTIN
70+
#define LED_BUILTIN 13
71+
#endif
72+
#define LedPin LED_BUILTIN
73+
6974
#define interruptPin A2
7075

7176
// Components.
@@ -82,7 +87,7 @@ void setup()
8287
{
8388
VL53LX_Error status;
8489
// Led.
85-
pinMode(13, OUTPUT);
90+
pinMode(LedPin, OUTPUT);
8691
pinMode(interruptPin, INPUT_PULLUP);
8792
attachInterrupt(interruptPin, measure, FALLING);
8893

@@ -122,7 +127,7 @@ void loop()
122127

123128
interruptCount=0;
124129
// Led blinking.
125-
digitalWrite(13, HIGH);
130+
digitalWrite(LedPin, HIGH);
126131

127132
status = sensor_vl53lx_sat->VL53LX_GetMeasurementDataReady(&NewDataReady);
128133
if((!status)&&(NewDataReady!=0))
@@ -152,6 +157,6 @@ void loop()
152157
}
153158
}
154159

155-
digitalWrite(13, LOW);
160+
digitalWrite(LedPin, LOW);
156161
}
157162
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=STM32duino VL53L3CX
2-
version=1.0.1
2+
version=1.0.2
33
author=STMicroelectronics
44
maintainer=stm32duino
55
sentence=Allows controlling the VL53L3CX (Time-of-Flight ranging sensor with multi target detection)

0 commit comments

Comments
 (0)