02. Virtual Switch example - ArmDeveloperEcosystem/Corstone-for-Arduino GitHub Wiki
About
This example will use the Arduino IDE's built-in Button example to turn a virtual LED on and off. Instead of using a button, it will use a virtual switch on the FVP's user interface.
The virtual switch has a value of LOW when white portion of the virtual switch is on the bottom, and a value of HIGH when white portion of the virtual switch is on the top.
Prerequisites
- AVH EC2 instance that is setup via the Getting Started with Corstone for Arduino guide.
Guide
- VNC into the AVH EC2 instance.
- Start the Arduino IDE:
Applications->Development->Arduino IDE
- Select the Arm Corstone-300 board
Tools->Board: ...->Arduino Corstone Boards->Arm Corstone-300
- Open the
Buttonexample:File->Examples->02.Digital->Button
- Change the
buttonPinconstant variable value toSW1. - Change the
ledPinconstant variable value toLED1. - Click the
Verifybutton to compile the sketch. - Click the
Uploadbutton to run the sketch.- This will launch the Corstone-300 Fixed Virtual Platform (FVP)
- The Corstone-300 FVP will launch, click the blue area of right most virtual switch, the right most virtual LED will turn on.

- Click the blue area of right most virtual switch again to turn the virtual LED off.

- You can close the Corstone-300 FVP by click on the
Xon the top right corner of the window.