As second project we will simulate a button with an 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 LED D13 and a button on pin 2. Connect the Arduino with the COM port in the simulator and watch the simulation. The serial port on a Mac is different than on a Windows device. A Windows device will name it COM and a Mac will have something like dev/tty.usb…