Saturday 21 March 2015

Arduino Tips & Tricks: 

 Simulate the functionality of Arduino boards on a simulation software PROTEOUS.

A simulator software gives you ability to test your code without actually running the code on the hardware. It virtually creates the environment of your target hardware. Proteous is one such simulator software. By default it supports simulation of code for 8051,PICand AVR controllers. But thanks to the hard work by developers who had made libraries that lets you even simulate an arduino code. All you need to do is download the files and paste them in the library folder of your Proteous software.In this post i will share with you the steps you need to follow.

Step 1: Download the library files from here.
Step 2: unzip the rar and you will find two files with extensions .IDX and .LIB. Copy them.
Step 3: Paste them in the library folder of your proteous. Depending upon the version of proteous you have the path will be either of the following.

C:\Labcenter Electronics\Proteus 7 Professional\LIBRARY

C:\Documents and Settings\All Users\Application Data\Labcenter Electronics\Proteus 8 Professional\LIBRARY

Step 4: If your proteous ISIS was already open close it and reopen it. Now you will be able to pic the arduino boards . Go to ISIS professional>component mode>pick from library.
similarly any other library can be added to the proteous.

Step 5: Now that we have got the libraries in place. Lets make a blinking program. write the following code in the Arduino IDE and hit the compile button. the sofware will generate  a hex file . If you donot know how to locate this file please visit my another post here

int led = 13;
void setup() 
  pinMode(led, OUTPUT);     
void loop() 
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second

Step 6: Make the connections and add the hex file.  After adding the hex file click on the play button in the left bottom of the software window.

If you followed everything correctly. Here is what you will see.

No comments:

Post a Comment