-
Notifications
You must be signed in to change notification settings - Fork 3
02. Virtual Switch example
Sandeep Mistry edited this page Mar 21, 2022
·
4 revisions
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.
- AVH EC2 instance that is setup via the Getting Started with Corstone for Arduino 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
Button
example:-
File
->Examples
->02.Digital
->Button
-
- Change the
buttonPin
constant variable value toSW1
. - Change the
ledPin
constant variable value toLED1
. - Click the
Verify
button to compile the sketch. - Click the
Upload
button 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
X
on the top right corner of the window.