User LEDs
This documentation includes installation guidelines and sample code for your hardware.
Overall Info
There are two user LEDs available onboard.
LED Connections
LED 1 (Blue): D2.
LED 2 (Red): D3.
Arduino Library
There is no need to add a library to control LEDs. All you need to do is defining LED pin numbers, setting pin directions and controlling them.
Initialization
To initialize the LEDs, first define the connections.
Then, set the pin directions as output.
Now, the LED configuration is ready.
Basic Members
Digital Write
Turns LEDs on or off.
Parameters
Pin: LED pin.
Value: LED state. "HIGH" or "LOW".
Returns
None
Examples
You can open the example from Arduino IDE > File > Examples > Examples from Custom Libraries > Turta MKR Sensor Shield > User LEDs. There is one example of this sensor.
LED Blink
This application demonstrates blinking of the LEDs.
To run the example:
Open the LED Blink sketch from the examples menu.
Select your Arduino MKR series board from the Tools > Board menu.
Select your device's COM port from Tools > Port menu.
Open Serial Monitor from Tools > Serial Monitor.
Select 115.200 baud from the Serial Monitor's status bar.
Upload the code to your device.
Sample Code
Result
After the application is uploaded to the device, it turns the LEDs on and off continuously.
The application runs forever until you clear it from memory.
Last updated