Grove - Push Button
This project will use a Grove Push Button to toggle a Grove LED on.
- Connect a Grove LED to a grove connector on your board and a Grove Push Button.
- Begin a new Grove project using the Grove Project Import method at the bottom of this page.
- In the Project Explorer on the left, under Sources, double click to open the file "arduinoApp.cpp".
- Copy and paste the following code into this file to replace it's contents:
//--------- Push Button Test
int ledPin = 6; // LED connected to this digital pin number void setup() void loop() |
- This code will turn on the LED whenever the Push Button is pressed and turn it off when it is released.
- Select Project from the main menu and choose Build Project.
- If there are any errors they will be displayed in the Problems tab.
Now follow the steps under Debugging your ARM Board Project.