In this project we will simulate a potentiometer with 10 LEDs. The potentiometer will control the LEDs as a bargraph. The potentiometer value (0-1023) is assigned to 10 values, 1 value for each LED. The codes in the sketches remaining the same as the normal sketches but there are just a few things that will be added to the setup in order to communicate though the serial port.
The library that we installed with the simulator is available in the Arduino IDE. By adding the ‘#include <SimulatorProgram.h>’ code we will include the library for the simulator to it. The library will communicate with the Arduino Simulator thought the serial USB port.
Select the used inputs and outputs on the simulator. In this case we use 10 LED from pin 2 to 11 and a potentiometer on analog pin A0. Connect the Arduino with the COM port in the simulator and watch the simulation.