Simulation steps

Step 1

In this project we will simulate a bargraph with LEDs that is level controlled by a potentiometer. The value of the potentiometer (0-1023) will be converted to a 10 LEDs range with the map instruction. This example can be found by the examples provided in the simulator under ‘Display’. The steps are shown in the video above.

Step 2

Upload the code to the Arduino board.

Step 3

Select the used inputs and outputs on the simulator. Drag the used parts to the workspace and use some tools to draw something or to add text. In this case we use LEDs on digital pins 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 and a button on digital pin 2. Connect the Arduino with the COM port in the simulator and start simulating.

You can restore saved setups by going under File and choose for ‘Restore settings’. Select the setup file and all the saved settings will be restored.

Instructions

The instructions that communicate with the simulator are based on similar Arduino codes. The simulator library codes are as follows:

digitalWrite becomes DigitalWrite

digitalRead becomes DigitalRead

Full list with all the instructions

Instructions Arduino IDE               Instructions Arduino IO Simulator

digitalWrite(x,y);                                 DigitalWrite(x,y)

digitalRead(x);                                    DigitalRead(x);

analogWrite(x,y);                                AnalogWrite(x,y);

analogRead(x);                                   AnalogRead(x);

myservo.write(x);                               myservowrite(x);

Serial.print(x);                                     Serialprint(x);

tone(x,y ,z);                                         Tone(x,y ,z);

noTone(x);                                           NoTone(x);

lcd.setCursor(x,y);                              lcdsetCursor(x,y);

lcd.print(longx);                                  lcdLprint(x);

lcd.print(“x”);                                       lcdprint(“x”);

lcd.autoscroll();                                  lcdautoscroll();

lcd.noAutoscroll();                             lcdnoAutoscroll();

lcd.clear();                                           lcdclear();

lcd.display();                                       lcddisplay();

lcd.noDisplay();                                  lcdnoDisplay();

lcd.blink();                                           lcdblink();

lcd.noBlink();                                      lcdnoBlink();

lcd.write(x);                                         lcdwrite(x);

lcd.rightToLeft();                                 lcdrightToLeft();

lcd.leftToRight();                                 lcdleftToRight();

lcd.home();                                          lcdhome();

lcd.cursor();                                         lcdcursor();

lcd.scrollDisplayLeft();                      lcdscrollDisplayLeft();

lcd.scrollDisplayRight();                    lcdscrollDisplayRight();

 

DHT11 sensor                                     DHTread11(pin number);

myservo1.write();                               myservo1write();      first servo of the 2 simulator servos

myservo1.attach();                            myservo1attach();     first servo of the 2 simulator servos

myservo2.write();                              myservo2write();       second servo of the 2 simulator servos

myservo2.attach();                           myservo2attach();      second servo of the 2 simulator servos

myKeypad.getKey()                         mykeypadgetKey();           keypad code