Arduino Simulator

I did a little googling and it seems that Virtronics has the best Arduino Simulator, as well as some links to other simulators. Why use a simulator? Well, the answer to that seems obvious. I don't really need intense peripheral compatibility, I just want to test pins going HIGH/LOW from switches, I2C communication, etc; pretty simple things.

My question is, has anyone used their simulator and can vouch for it? What about any of the others (Emulino, ArduinoSim, Simuino)? It would just be nice to be able to find out if this program is useful before I potentially buy it (because the free version has garbage limitations), as well as know if it is even capable of doing what I need.

Thanks,

...

Why use a simulator? Well, the answer to that seems obvious.

Not to me it doesn't. There is little you can't sort out with an LED and some print statements.

My apologies, when dealing with multiple Arduinos and a lot of wiring where the computer is the only display, a simulator, or at least a better IDE than the basic Arduino IDE would be useful when dealing with lots of changes in the system, as well as being able to monitor what is going on.

If you know a capable IDE that is more programming oriented I would be open to suggestions. It just seems the Arduino IDE is not very useful for code that is 500+ lines in length.

*edit, also, print statements heavily slow down the speed at which the code moves, and when I need fast communication, I can't be waiting for print statements to evaluate (Just tested this and it blows).

Many of my sketches are 500+ lines. Some 2000. It is also possible to run out of memory with 500 lines.

*edit, also, print statements heavily slow down the speed at which the code moves, and when I need fast communication, I can't be waiting for print statements to evaluate (Just tested this and it blows).

That is only true if you are profligate with your print statements. However, if you can't cope with it then maybe you need an emulator. But it is much better to think than to thrash about with an emulator.

cypherrage: *edit, also, print statements heavily slow down the speed at which the code moves, and when I need fast communication, I can't be waiting for print statements to evaluate (Just tested this and it blows).

You just need to be smarter about what you print and when. If your application is producing trace output faster than your output stream can handle it then you're probably doing it wrong.

cypherrage: If you know a capable IDE that is more programming oriented I would be open to suggestions. It just seems the Arduino IDE is not very useful for code that is 500+ lines in length.

I agree the arduino IDE is terrible I just use avr-gcc. For text editing I use http://www.geany.org/ I use it with GNU/Linux but there is also windows binaries if are stuck with windows.

I've lost count of the number of development environments and emulators and simulators and debuggers that I've used over the years. The ability to get output from print statements makes it possible to debug almost anything, and is available in almost all development environments, so this is pretty much the lowest common denominator. With the right mindset and some patience, almost any problem can be found using this.

Where more sophisticated debugging tools are available such as simulators and emulators and source level interactive debuggers and so on these make it more convenient to do the things that you can do with print statements, but that's all. That convenience gets more important when you're dealing with large complex applications, but Arduino sketches are teeny tiny little things in software terms and hardly justify effort making debugging more convenient, especially since the compile/build/test process is so quick and easy. Then again, for some types of problem simple trace statements actually are the easiest way to solve the problem, and even when emulators and debuggers and so on are available they would be the wrong tool for the job.

I use the Arduino IDE not because it's good (it's pretty appalling) but because it's convenient, and good enough that it's not worth the bother of looking for an alternative. If I wanted an alternative, then Visual Studio and Eclipse would be the first ones that come to mind.

Hi Cypherrage, thanks for agreeing with us that Simulator for Arduino is the #1 ranked Arduino Simulator. We saw this thread a while ago but Google Alert keeps sending emails about it.

Here is another thread on the Element-14 website which has some more info about other Arduino Simulators

With the Simulator, we have just released a new version v0.98G and have been asked about a roadmap. The changes in the latest version are to add anew Tool - a Logic Analyzer which can show the state of the pins graphically. This is a first effort, doesn't have a time base yet, only works for digital pins 0 to 13 and has no scroll bars. It gets its feed from the trace text file which now shows the digital pins state. Another change is to add the Papilio hardware platform and sort out the digital pins - Papilio is an FPGA version of the Arduino which works with a modified Arduino IDe called the ZAP IDE.

Another program is Virtual Breadboard but we haven't tested that out.

With the Free Version of the Simulator, there is an Unlock process which should allow for 8 days of unlimited use on any computer which doesn't have the Simulator installed. After that time, a 30 second incrementing timer will kick in. The Pro version costs $12 and last until Dec31 with a renewal option after that for another year.

The Simulator is not perfect but we have implemented a semi-automatic error reporting process so we can fix any common errors. The number of errors is definitely decreasing. The limitations of the Simulator are shown in the webpage with pointers being the biggest limitation and classes are handled but that is not 100% perfect yet. Simple sketches will run fine but complicated sketches may or may not run. Everyone is welcome to send in sketches which the Simulator cannot run and usually it only takes a few hours to find the cause. The Simulator is also supplied with a few hundred demo sketches for various users.

There is little you can't sort out with an LED and some print statements.

The above mirrors my general attitude on the process. The uC environment has the same benefits that the PC brought to programming; that is, the iterative process... Not like in the days when the engineering department was charged for every batch run!

While a complete debugger environment has numerous advantages, many people getting into the uC maker movement would be lost with such tools. Many are trying to compile example sketches and the problem is their breadboard connections. Therefore the LED statement rings true,

However, while I have 3 oscilloscopes around the bench, signal/pulse generators, multimeters, and such I often find that this little device I made is far more useful: http://forum.arduino.cc/index.php/topic,135623.0.html

Being an Arduino with a USB interface, it "sees" exactly what another logic gate would see and it also brings out 8 digital channels and 6 analog channels to the PC. A real poor man's logic analyzer.

ALSO, I have found this sketch and PC software (all free) to be very useful and borderline entertaining: http://forum.arduino.cc/index.php?topic=109212.0

At this point, I do not personally think that most Arduino users will benefit from non-free tools. And professional developers are likely using professional tools for AVR and programming outside the confines if Wiring. There is a tremendous benefit for the new programmer-maker to THINK their way through issues without throwing money and new toolsets toward the problem.

  • Ray

mrburnette: At this point, I do not personally think that most Arduino users will benefit from non-free tools. And professional developers are likely using professional tools for AVR and programming outside the confines if Wiring. There is a tremendous benefit for the new programmer-maker to THINK their way through issues without throwing money and new toolsets toward the problem.

Agreed.

I know this is an old topic but I came across it while googling and wanted to share something in case others found their way here looking for a virtual Arduino.

Autodesk has made a free web based program called 123D Circuits and I find it awesome. You can hook up virtual components and bread boards to your virtual Arduino and write your sketch and test it. As you build you can also switch to schematic mode and you can even design your PCB boards and get them sent off for printing.

I havent been using it long but I already love it. I personally like the virtual method because I can save my designs then work on them at a later time for instance in my lunch break at work etc.

http://123d.circuits.io/ https://vimeo.com/73973905

You can hook up virtual components and bread boards to your virtual Arduino and write your sketch and test it. As you build you can also switch to schematic mode and you can even design your PCB boards and get them sent off for printing.

I watched the video & read the intro. I suspect many forum members may object to this drag&drop method of writing code; arguments may be that it distracts from learning how to truly program or perhaps it completely sidesteps learning the basis of electronics. I have not yet used this simulator, but I will try it. I do not see any major reason this should not be considered in the same space as tools such as SPICE. Spice did not disrupt the EE field and ius now fully entrenched in university's courses.

The above said, SPICE is mathematically based and the auto a programming is template based: apples & oranges comparison. The code generated is no better than the dude(tte) that wrote the template.

However, as an active member here in the forum for helping newbies over silly problems and self-inflicted wounds, there is a common theme I hear from newbies.... "I want the code to..." ... It is a desire for immediate gratification.

Few newbies want to go the old way of learning from the bottom up; rather, they want to jump into the Arduino waters and if they are drowning, they expect a senior member to be their lifeguard... It is a scenario that does not scale as more newbies come online. Therefore, I think that being able to generate simple, workable Arduino code using drag&drop for common needs is really very significant and I do not see this technology overly disruptive to the ecosystem.

Bravo Autodesk!

The ability to get output from print statements makes it possible to debug almost anything, and is available in almost all development environments, so this is pretty much the lowest common denominator. With the right mindset and some patience, almost any problem can be found using this.

In keeping with PeterH's comment, the following home-brew piece of test equipment may be most helpful as it allows a dedicated serial monitor and a dedicated serial output stream. http://forum.arduino.cc/index.php?topic=235793.msg1695970#msg1695970

Ray

Hmm, interesting perspective, I hadn't even considered it as as a learning tool, I'm prety fluent in code and semi-capable of doing electronics. I mainly like the ability to plan my projects anywhere.

I hadn't even noticed the code drag and drop, and your correct that the best way to learn that sort of thing is to write it your self. As a learning tool though there are only so many LED's some people are willing to blow while learning so can be useful to test out things to see what happens when you are just getting started.

Do these simulators release virtual smoke if you get things wrong? :smiley:

nah, they bur out you CPU instead XD

AWOL: Do these simulators release virtual smoke if you get things wrong? :D

Ah, as a young teen building Knight Kits, nothing quiet said "poof" like a bad selenium rectifier!

Ray

http://forum.arduino.cc/index.php?topic=235793.msg1695970#msg1695970
Ray

I like this.

LarryD: Ray

http://forum.arduino.cc/index.php?topic=235793.msg1695970#msg1695970 Ray

I like this.

Thx. The old (just send) design was great for quick 'n dirty ... nice when you have a known source generator and you are working on a parsing algorithm or some insane input routine. The new version is twice the fun since it can send and receive. For enterprising forum members, the Mode buttons could drive a simple GLCD menu which would store to eeprom the settings to use. I almost always only work during development with 4800/9600 BAUD, so not having a menu is no big deal to me. The other neat thing that can be done with just a few lines of code is to have an option to store (from a PC terminal program) an alternate output string, say "Now is the time for all good men to come to the aid of their party." or something like that.

Added: You could drop the price by $3 by using a Pro Mini instead of a Pro Micro.

Regards,

Ray

I am also sorry for digging up this dead horse, but I wanted to add fresh newbie perspective to the immorality that is code generators.

See, what has brought me into the wonderful world of micro controllers was (forgive for lack of better terms) the advertisements I saw on youtube videos when researching a means to better automate my indoor garden. For me, my ability to generate produce will soon become the way I feed myself and family, but with declining health my abilities are not what they once were. With that said,I want to make it easier, hence micro controllers. What brought me to Arduino as opposed to Beaglebone and Raspberry Pi was "there is a bigger community" for Arduino. So I went out and bought me an Uno R3, played with a few sample sketches, then soon upgraded to a Mega w/ Ethernet shield So I can use my Mega online with Arduino Commander (Android app). All while doing research in spare time of how to build DC electronic circuits that would apply to my desired end project. None of this stuff was previously learned by me, and no, I cannot afford to go to a University to learn how to code, I have to make sense of the Reference page, various internet tutorials and the bits of insights I can find in old threads such as this.

I've posted questions and have gotten some answers, but when it comes to code questions, the best I can unearth is "suggested approaches" on how to write up a code for a specific aspect of my project. That is great and all, but I still don't yet know enough to verify if what I am reading would even work. Should I then invest the next 3 months reading about everything I can find about that subject, learn what applies or doesn't then sheppardise the subject matter down to what I should be learning?

If Arduino is meant to be the gateway micro controller for University students only, than I have found myself to the wrong place and perhaps Beaglebone Black forums would be more welcoming to the common (uneducated) folk. But if Arduino is also geared towards the free learning people such as myself that can barely afford to live, than I suggest updating the mindset that I must learn from the ground up to one a little more inviting and less burdensome to you (my teachers). When I ask questions and you give replies in words that you think I need to hear, this usually frustrates me because I don't know a fraction of all the things that you know and I simply cannot comprehend your answers unless I first digest all the materials that like has taken you years to learn.

If I can use a code generator, I can learn through reverse engineering at my convenience. Believe me, I want to learn code more than you think I do. I just don't want to wait until I learn how to write code (all inclusive) to actually write my first simple (not sample) code. These generators would allow me to progress my learning curve beyond the curriculum level that my untrained researching skills would limit me to. Google is great, but it's not the only thing I should have at my disposal, otherwise why would I even join a forum to begin with?