Skip to content

02. Virtual Switch example

Sandeep Mistry edited this page Mar 21, 2022 · 4 revisions

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

Guide

  1. VNC into the AVH EC2 instance.
  2. Start the Arduino IDE:
    1. Applications -> Development -> Arduino IDE
  3. Select the Arm Corstone-300 board
    1. Tools -> Board: ... -> Arduino Corstone Boards -> Arm Corstone-300
  4. Open the Button example:
    1. File -> Examples -> 02.Digital -> Button
  5. Change the buttonPin constant variable value to SW1.
  6. Change the ledPin constant variable value to LED1.
  7. Click the Verify button to compile the sketch.
  8. Click the Upload button to run the sketch.
    1. This will launch the Corstone-300 Fixed Virtual Platform (FVP)
  9. The Corstone-300 FVP will launch, click the blue area of right most virtual switch, the right most virtual LED will turn on. Button-Switch-LED-on
  10. Click the blue area of right most virtual switch again to turn the virtual LED off. Button-Switch-LED-off
  11. You can close the Corstone-300 FVP by click on the X on the top right corner of the window.