Go Down

Topic: Using Code Explorers and Diagrams to Learn Arduino (Read 17030 times) previous topic - next topic

visualmicro

Sep 17, 2012, 05:35 pm Last Edit: Sep 21, 2012, 03:03 pm by Visual Micro Reason: 1
The free Arduino Plugin for Visual Studio 2012 provides some very useful tools that makes learning Arduino a little bit easier. (Read how to get Visual Studio for free at the end of this post)

One of the tools is the "Class Diagram" which is available to all components of any Arduino project. Below you can see the relationship that exist in the Ardino core to the "Print" class.



Development of both simple and advanced Arduino projects benefit from being able to quickly visualize and understand the  code.

The free Arduino pugin for Visual Studio 2012, 2010, 2008 is available from here.

Instructions of how to download a legal copy of Microsoft Visual Studio 2012 Professional for free from here

Edit: Based on feedback from experienced users I have altered the picture to show a slightly simpler representation. The previous image showed all the Arduino connections to the Print class which was a little more complex.
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

CrossRoads

I don't know about you, but that diagram does not do anything for me.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dxw00d

I know what you mean. I used to get massive wall charts like that with each release of Delphi. They always stayed folded up in the box.

Quote
Instructions of how to download a legal copy of Microsoft Visual Studio 2012 Professional for free


Provided that you agree to have published a web based application through the WebSpark site within the first year, and keep your details regularly updated during the three year period.

visualmicro

@CrossRoads, I wouldn't expect seeing the relationships of the Print class to do much for a global moderator :) However, as an experienced user I think it is easy to loose sight of what new users do not know.

I think that new users trying to learn inheritance and how to structure code correctly will find this feature very useful which is why I specifically added this post to the "Education & Teaching" board.

No matter which project users might become involved with, the first job is to understand the structure of the program code. Being able to pick ANY class or area of code and have an diagram displayed instantly on the screen is very useful, as are other features of Microsoft Visual Studio such as jump to definition and code suggestions/completion.

Before looking at the diagram I wasn't entirely sure of the relationship the Print class has with other core Arduino code. I could have added a more complex example but I wanted to stick with something that most people will already be using, HardwareSerial (Serial.print) seems one of the the most common Arduino examples.

In the example in my first post, we can see how the arduino HardwareSerial is inherited by the Stream class which in turn is inherited by the Print class. The Arduino addin for Visual Studio will automatically recognize all Arduino projects and seamlessly configure Visual Studio to provide a 100% compatible Arduino development environment. So we get best of all worlds and a very informative programming tool.

I appreciate your feedback and will take some time over the next week to post more examples that might show the benefit of the Visual Studio code explorers in more detail.

In the meantime here is an example of what I believe is very useful. The largest Arduino project I know of is the APM project at diydrones.com. Apm is an extremely efficient Arduino program that supports a huge range of different sensors. The design of the apm gps class should be a good lesson for many new users, especially students attempting to increase their expertise in C++/Arduino programing.

Below is a dynamic class diagram of the apm gps system. In my own geeky way I love how easy it is to understand this clever code using Visual Studio



Incidentally, the ground control telemetry project at diydrones is open source and is also built using Visual studio.

@dxw00d, yep the free tools also allow us to build windows, mobile and web applications. So we can build telemetry apps that display data from our Arduino projects or we can build Arduino programs. There are hundreds of thousands open source examples that we can modify, then we can even upload them to WebSiteSpark. However, it isn't policed that strictly so as long as we are learning Visual Studio then I am sure Microsoft won't complain :) As concerns keeping your details up to date, that isn't very difficult and it's worth it for so much pro software for free.



Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

dxw00d

Yes, you are constantly pushing this 'free' offer, but not explaining that it isn't a free lunch, and that there are obligations placed on you for using the software. MS provide the express versions for those that do want to legally download VS for no cost at all. The WebSpark program was not intended to provide freeloaders with a full copy of VS.

Quote
as long as we are learning Visual Studio then I am sure Microsoft won't complain

Because, of course, you purchase a full license when the free one expires at the end of the three years.

visualmicro

#5
Sep 18, 2012, 02:22 pm Last Edit: Sep 18, 2012, 02:28 pm by Visual Micro Reason: 1
@dxw00d I don't that only Microsoft can comment on what the program is intended for. The few soft obligations do not cost any money, the product is free. I get many emails of thanks each week from the many users who are enjoying the free software and finding their Arduino coding to be much more fun. Some people have even blogged about it all so it is free and they are very happy.

In the last year Microsoft has relaxed the rules, previously we had to be considering a career in web design to gain Visual Studio and 1000's of dollars of extra software for free. The new rules are quite clear and can be found  here (the eligibility statement from Microsoft)

Quote
Who is eligible for WebsiteSpark?
To be eligible for WebsiteSpark, you must meet one of the following criteria at the time of joining:
Company: A privately held professional service firm whose primary business is providing Web development and design services for its clients and has no more than 10 members, which includes owners and employees (maximum of 25 members for Brazil, China, India, and Japan),
or
Individual: An individual that does not have his/her own company and/or does not work for a web design or development company.


BUT let me be even clearer that this is a free offer open to all. Back in November 2011 Microsoft decided to blog about the Arduino plugin for Visual Studio. In the comments of the blog I openly raised the point that Visual Studio can be downloaded for free. You can read the blog and the discussion on the Microsoft Codeing4Fun Blog http://channel9.msdn.com/coding4fun/blog/Visual-Studio-20082010-and-Arduino-Yep.

Microsofts Blog Title: Visual Studio 2008/2010 and Arduino? Yep!

Quote
While I don't usually highlight Arduino related projects, since there's often little Microsoft relation, I saw this and knew I had to post on it... I mean how much more Microsoft can you get!

A complete Arduino development system for Visual Studio 2008 and 2010


From my point of view I am very happy that this free solution is available to everyone. There is no cost to signing up and getting this software and there is nothing hidden or underhand about what we are doing. This solution helps so many people learn and program Arduino, I don't know why anyone would be negative about this free solution or why they would try to take this away from the community?
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

dxw00d

I'm not trying to take anything away from anyone. I am just trying to point out that it isn't simply a free lunch. If it was, there would be no need for the express editions of Visual Studio. At the end of the three year period, your license expires, and you should then purchase a full license to continue using the software (with the exception of Expression Web, which you get to keep), or stop using it.

visualmicro

#7
Sep 18, 2012, 03:29 pm Last Edit: Sep 18, 2012, 03:34 pm by Visual Micro Reason: 1
Yes you are right but who knows what will be available in 3 years. I am working on a version for the free Atmel studio which is also a version of Visual Studio (but not as functional as vs pro).

3 years is a long time, it would seem a shame to miss out on an easier and more fun environment just because it might not be free in a few years. To be honest, if I hadn't of written the plugin I would have moved away from Arduino a long time ago. It has been a lot of hard work but the end result is great fun and removes much of the constant need to look for Arduino reference guides.

I do see your point, I used to make a big thing of the three year time limit but in the end decided it is not a reason to avoid using the tools and that the 3 year limit is always clearly shown on the page that I link to.
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

udoklein

I got burned by the "free" visual studio twice. So I will happily use it work but definitely not at home. With regard to the print class diagramm: it makes it blindingly obvious that the design for print is somewhat screwed. But I do not see how this facilitates any in depth understanding ;)
Check out my experiments http://blog.blinkenlight.net

visualmicro

#9
Sep 18, 2012, 08:07 pm Last Edit: Sep 18, 2012, 08:11 pm by Visual Micro Reason: 1
Hello, I am sorry to hear that, I am struggling to understand how you can get "burned" downloading free software direct from the Microsoft web site? If you can please explain so that I can add a knowlege base article of your experiences.

If it helps, here is a link to a page published today by a new user that has happily installed Visual Studio and the Arduino plugin. The publisher has just joined the debug tool beta group so the article covers some extra stuff that you can ignore.

Quote
With regard to the print class diagramm: it makes it blindingly obvious that the design for print is somewhat screwed


It's very good to hear that seeing a graphical diagram can also be used to identify coding mistakes. In terms of understanding, it's just an example, maybe my 2nd example in this post is more relevent for experienced users.

I can say that we have good feedback from the people that are actually working with the 2nd example.
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

retrolefty

Microsoft's free offer or not aside, it just at first appearance to me looks like that the MS studio IDE is much more intimidating and complex compared to the the very simple and easy to use and understand arduino IDE. I came to arduino with a lot of hardware experience but limited software experience. My limited experience was with Borland's original Turbo Pascal IDE. I found the Arduino IDE very easy to figure out from the very start, I think because of the few choices one has to figure out to get a sketch entered and verified and/or uploaded. I suspect I would have passed on the whole arduino platform if I was first presented with the studio IDE to navigate on my own.

So ease of use for raw beginners compared to the arduino IDE? Color me very very skeptical of that claim, unless you have hard data to back that claim, rather then just an opinion?

Simplicity is one of the corner stones that made the Arduino platform the success that it has become. A professional IDE does not seem to me to met that objective.

Lefty

visualmicro

#11
Sep 18, 2012, 09:14 pm Last Edit: Sep 18, 2012, 10:14 pm by Visual Micro Reason: 1
Hi Lefty,

I agree that without the plugin Visual Studio would be as impossible for new users as Eclipse, Netbeans or any other IDE than the Arduino.

However, the plugin does what the Arduino IDE does and is installed from a one-click installer. It makes things very easy yet provides intellisense suggestions and help.

Code completion suggestions as we type make it a must for anyone who does not know the Arduino syntax and especially for new users.

NB: If Eclipse is your preferred route then there is a great Eclipse plugin that also helps. As a Microsoft user I prefer Visual Studio but everyone has their own preferences

There is one click compile and upload, board selection, serial ports and a simple sketch creation system that just requires the name of a sketch. It's that easy!

There are plenty of articles on the web, not authored or associated to me, from people who are pleased to have this option instead of the Arduino IDE. I can provide some links if required but we all have google :)

The plugin is free, there are no adverts on the visual micro web site and a forum/wiki is also provided free. It is a great option for many and this is the right place to tell people about it.

Below is an example that shows how we have, in Microsoft Visual Studio, the same simple options that are provided by the Arduino IDE. I know the image shows two Arduino projects open at the same time that some might consider confusing but this is an optional feature that I like to use in my testing. I also recognise some extra clutter on the tool bars which can be hidden using the right click menu. However, the "clutter" can be ignored, there are no options that need to be set other than a serial port (or programmer) and the board.



Finally, I do appreciate that there are many different types of "new users". I speak for the ones like myself a few years ago when I was suprised to find how little support the Arduino IDE provided. I had to search the web or open an example to learn every single command. I found it a painfully slow and fustrating process.
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

Jantje


NB: If Eclipse is your preferred route then there is a great Eclipse plugin that also helps new users, but is not as easy as Visual Studio.

I'm happy to see you mention my "completely free open source plugin" (At least I hope it is eclipse.baeyens.it you are referring to). :D
Not sure how it compares to the visual studio plugin so I can't confirm/deny that it  "is not as easy as Visual Studio". I hope you know what you are talking about.

I have been in software development for decades now with lots of different IDE's (amongst them microsoft visual studio) and from my experience I'm completely with Lefty when he states
Quote
just at first appearance to me looks like that the MS studio IDE is much more intimidating and complex compared to the the very simple and easy to use and understand arduino IDE.

The Arduino IDE is extremely simple letting the newbie focus on the important stuff. Any real IDE is to complex for a newbie. There are to many windows; to many buttons; to many short cuts; to many menu items; ....
I considered (but rejected) to make an "arduino simple perspective" in eclipse to have the same simplicity in Eclipse as the Arduino IDE offers. I decided not to do so because I would have to spend lots of time and never get to the Arduino IDE simplicity. Even if I could I would lose the power of the IDE.
What I'm trying to say: You have developed (or are supporting) a very well written free plugin in one of the worlds best (commercial) IDE's. Which is great work which will be appreciated by many. However any statement in the sense of "as simple as the arduino IDE" is undermining your credibility amongst the more experienced of us.
This is what makes me say "I hope you know what you are talking about." in the first part of this response; cause I think you do not.

All the best to you
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

visualmicro

#13
Sep 18, 2012, 10:01 pm Last Edit: Sep 18, 2012, 10:18 pm by Visual Micro Reason: 1
Hi Jantje,

Well it's always interesting to hear the opinions of god members :) I've looked at your eclipse plugin and as I said earlier it really helps but the install instructions alone are more complex to use.

I found installing Eclipse to be quite difficult so, unrelated to your plugin the Visual Studio install was easier.

As I have said before, what is a new user? I speak for people like myself that found the Arduino IDE very difficult to work with without intellisense. I also found that when loading existing Arduino projects it was very difficult to see how code was related. In Visual Studio we just right mouse click any code syntax to GoTo definition or to "Find all references". As a new user to any project this type of tool is VERY useful.

So this is a preference for some to have a full interface and good source navigation/help and for others an empty clean interface and no source code help. I don't think anyone can say which is the best. It is that all options are right but for different groups of users. It is up to each user to decide what they choose.

The Arduino Examples and Documentation explorer in Visual Studio allow users to easily open or clone existing Arduino examples which is great for new users. The Arduino IDE has some of this functionality I don't believe Eclipse has this yet.

Anyway I am not going to get into a bun fight. I am sure that Eclipse has some features that are not available in Visual Studio, I just found it a terrible pain to install and very difficult to use.

So I believe, from my perspective and many of the users of Microsoft Visual Studio perspectives that I do know exactly what I am talking about.

Thanks again for your feedback
Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

visualmicro

Okay I have relooked at my words and altered them slightly. For fear of getting off point I have altered my statement to...

Quote
NB: If Eclipse is your preferred route then there is a great Eclipse plugin that also helps. As a Microsoft user I prefer Visual Studio but everyone has their own preferences


Arduino for Microsoft Visual Studio Pro and Atmel Studio 6.1 http://www.visualmicro.com
Arduino Debugger http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx

Go Up