|
Open Tools>Board>Boards Manager from the menu bar, search for nRF5 and install “Nordic Semiconductor nRF5 Boards” by Sandeep Mistry
|
|
Wait for the installation. It will take a while.
|
|
Select BBC micro:bit from the Boards menu.
|
|
Set SoftDevice to S110.
|
|
And set the Port to the Micro:bit COM port.
|
|
Start your Arduino IDE, then click on Preferences.
|
|
Add the URL into the Additional Board Manager URL text box
|
const int buttonA = 5;
const int buttonB = 11;
void setup()
{
Serial.begin(9600);
pinMode(buttonA, INPUT);
pinMode(buttonB, INPUT);
}
void loop()
{
if (! digitalRead(buttonA))
{
Serial.println("Button A pressed");
}
if (! digitalRead(buttonB))
{
Serial.println("Button B pressed");
}
delay(150);
}
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.