User Manual: Arduino Simulator 1.5
User Manual: Arduino Simulator 1.5
USER MANUAL
XEVRO
Version 1.5.1
Xevro© 2019
This manual describes all features and capabilities of the Arduino
Simulator.
This Arduino IO Simulator is designed to test an Arduino program quickly with the
Arduino board without really having connections to external IO (buttons, potentiome-
ters, leds, LCD displays, ...) and add a nice custom drawing around it to get a better
simulation experience.
- Java JRE
- The Arduino simulation program
- The Arduino IDE
In order to use the Simulator we need to download the Java JRE on our computer,
you can find the download link on the website of Xevro.
ARDUINO IDE
For we start using the Arduino Simulator we need the Arduino software, it is also free
available on the Arduino website: http://arduino.cc/en/Main/Software
Click on the ‘Change Product Key’ to insert the license key you copied on the website,
after entering this you need to click on ‘activate’.
Example 1:
digitalWrite(12, HIGH);
Become DigitalWrite(12, HIGH);
Example 2: lcd.print(“Hello world”);
Become lcdprint(“Hello world”);
What to do:
attention:
Remember to adjust the 'Void Setup to initialize the real IO!!
In each sketch are the instructions changed, so you only need to connect the inputs
and outputs through the screen and the sketch should work.
2. Add the used components (I/O) in the worksheet. (there are some examples that
are already saved in the restore settings)
Connect the Arduino board Write your own custom code and
add the Arduino Simulator library
Connect the Arduino Simulator to the Arduino board with the right
COM port
Only the digital and analog pins that are available on the Simulator can be used!
Disconnect the Arduino Simulator before uploading the Arduino code.
2. Upload your custom Arduino code with the corresponding library file
Open the simulator and go to 'Help -> Arduino UNO programming code -> Arduino
UNO programming code (Ino)’.
This will open a Arduino (ino) file with the corresponding library and important code
in it.
3. Change the original Arduino code
In order to let the Simulator understand the code, we have devised our own instruc-
tions. To maintain the usability, we have decided to change the current instructions a
little bit and replace only the first letter with a capital letter. We have modified the
instructions with a point so that the point may be omitted.
Attention:
- At start-up, we also see the state of the simulator at the bottom of the COM port:
Once you have selected the correct COM port changes to this text:
- If you choose the wrong COM port or there is no Arduino connected than you get
this message:
- If you select a in or output that is already used you will get an error message:
BUTTONS
There are 8 buttons available. The combobox is used to connect the button to one of
the 14 IO pins.
The light blue pin can be used to hold down the button
while doing other things, the border changes to red when
its pressed.
LEDS
There are 14 leds available, for every pin of the Arduino 1 led. Use the combobox to
connect it with the Arduino. By clicking on the led you can change the color.
The buzzer can be controlled with the DigitalWrite(); function. By sending out a Digi-
talWrite(pin, HIGH); signal in the Arduino code, the buzzer will make a noise with the
adjustable frequency (use the slider to change the
frequency).
7 SEGMENT DISPLAY
The 7 segment display has 7 digital pins that can connect to D0-6 on the Arduino.
The display can be connected in common anode or common cathode.
SLIDERS
There are 3 sliders to connect with one of the 6 analog pins (A0-A5). The sliders can
be read by the Arduino with the AnalogRead() function. On the Arduino you have a
white box where the slider value is shown.
When you click on the ‘Start Noise Detection’ the detection starts listening to the mi-
crophone noise level. When the noise level exceeded the slider value then it will
sends the signal (0-1023) to the Arduino. The limit value in the Arduino code needs
to be lower than the noise detection slider because the signal will be send when the
noise is detected.
BARGRAPH
The bargraph can be connected to one of the 6 digital PWM pins of the Arduino. The
bargraph shows the % of your value (0-1023), this can be used to simulate a PWM
signal as a % bar.
Use AnologWrite(pin, value); to control the bargraph (See example: sound switch).
By changing the time (ms) you change the duration that the sound goes off (1ms –
10 000ms). The frequency can goes from 10hz to 10Khz.
SERVO
The servo can be connected to one digital pin (D12) of the Arduino. The amount of
degrees (°) are visible in the servo. With the MyservoWrite() you can control servo.
LCD DISPLAY
The LCD display can be connected to the Arduino by connecting D2-5, D11 and D12.
All the instruction that controls the LCD are changed by removing the ‘.’ point.
TONE MELODY
The tone melody can be connected to digital pin D8 of the Arduino. The frequency
and time of the sound (milliseconds) are present in the light green boxes.
Use Tone(8, f, d); and NoTone(8); (See example: Tone Melody)
When you click on the ‘SquareWave’ button there opens a second window with a
slider to change the frequency.
The great advantage of this is that we don’t need to shut down the Simulator when-
ever we want to upload the sketch simulator.
After downloading the simulator, we connect again with the COM port and we initial-
ize the I/O.
Save Restore