Pages: 1 2 [3]   Go Down
Author Topic: arduino simulator  (Read 11474 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Take the Red Pill
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>Any chance this is going to run on non M$ platforms?

I discuss this briefly here.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270494815

Summary is: Chance -- yes. Soon? Not so much but it iwll happen.

>there are some way to add some sort of resistor somewhere?

VBB models circuits at the function block level. You need something like SPICE if you want to design at resister level. However as you can see modelling at the function block level is easier and in many ways more powerful.. more on that soon.

>For example: how can I recognize the cathode/anode of a LED component?

Well the LED component has a property to expose the cathode if it is used otherwise it is assumed to be connected to ground by default. However the point is valid and you may have to change the way you look at a circuit a little to make best use of VBB as a software development tool.
« Last Edit: April 14, 2010, 09:18:39 am by VBB » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yup here http://www.virtualbreadboard.com/ i used it before io  bought and arduino lol you can upload your own code directly for the arduino enviorement after you save it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@VBB

This looks great!

I have a sketch that has a PDE file and three cpp files.  Will that work here?  How to I add the cpp's?

Thanks,
Charlie O.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Take the Red Pill
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>I have a sketch that has a PDE file and three cpp files.  Will that work here?  How to I add the cpp's?

I was just working on this for the next release right now!

It should work as long as you use only the Arduino language in the cpp files. I will post again when the new release is up - I am including the Morse Example in the next release to show how its done.
Logged

CT, USA
Offline Offline
Sr. Member
****
Karma: 3
Posts: 446
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Any plans on open source this app?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Take the Red Pill
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

>I have a sketch that has a PDE file and three cpp files.  Will that work here?  How to I add the cpp's?

VBB 3.5.7 is available now with User Lib Support. See here for more
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1270494815

>Any plans on open source this app?

There is a component development kit (VBBDK) which allows component development from Visual Studio. The user extensibility is called OpenVBB and is an OpenAPI. The VBBDK is available on request if you are experienced with VisualStudio and will be more broadly available soon. Hence the extensibility is open ( which is what most people are interested in anyhow ) but there are no immediate plans to make the VBB application itself open source.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@VBB,

Great news on the CPP files!

One other thing that I've noticed but that might be more difficult...it seems that the systems does not like compiler directives (e.g. DEFINE) after any code statements.  Don't know if that's a complex part of the parser or easy but would be helpful to not have to have the constraint.

Thanks again,
Charlie
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Take the Red Pill
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are still a few uglies to sort out, including yes, I think I limit the search for DEFINES to before the setup() code segment so I will see about extending that search.

The technique I am using is more of a source code-transform than a compile so you can trick it up if your not careful.

Its an emulation of the Arduino language not a simulation of the ATMEL processor so this means

- Inline assembly and generic cpp libraries wont work so you need to only use the Arduino language even in cpp libraries
- Any real-time library - such as PWM or Servo etc will require explicit emulation support implemented by me
- The level of Arduino language support is documented by the examples in VBB - these are essentially my unit tests. If something doesnt work you should send me the example code so I can add it to the example/test suite.
- Some of the data types are different, eg byte is signed, and this can be a problem when declaring a byte more than 128 in value - you need to cast it.
- There are no unsigned types supported but you can work around this usually. The most common is how to use byte.
 eg byte a = (byte) 200; // without the (byte) will give an error
     int ubyte = a & 0xFF; // this will make ubyte int = 200 instead of -56
- In general compile time problems can be overcome by explicit casting as opposed to the implicit casting used by Arduino. Its still compatible code but Arduino compiler does some extra work in performing implicit casting which I need to catch up with.
- Standard form declarations should be used eg int<space>foo() not int<space><space>foo() as this can become a problem
- Not all array constructs are yet supported, for example Servo servos[5] should create an array with 5 servos but doesnt and multidimensional arrays can be a problem too.
- Sometimes the syntax editor is marking problems with red unline which are not really problems.

As we go along I will be improving support, adding examples(unit tests) and even more :-)

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

Re: Arduino simulator, I just found emulino: arduino cpu emulator which is GPL, and posted build instructions on Emulino - Ubuntu Wiki.

Cheers!
Logged

Washington
Offline Offline
God Member
*****
Karma: 39
Posts: 808
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an error with virtualbreadboard:
SystemType loadexception
Logged

Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!

0
Offline Offline
Newbie
*
Karma: 0
Posts: 32
Take the Red Pill
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

If you could, could you make a bug report with some more details here. Especially you shuold report if you are using a particular library because not all are supported.
https://virtualbreadboard.fogbugz.com/default.asp?

Make sure you check the installation notes to see if you are missing a dependency

http://www.virtualbreadboard.com/home.htm#InstallationNotes

Thanks!
« Last Edit: May 13, 2010, 02:03:54 am by VBB » Logged

Pages: 1 2 [3]   Go Up
Jump to: