Go Down

Topic: Visual Studio (Read 4643 times) previous topic - next topic

Graynomad

Quote
If and when I "Learn' enough language for the Arduino to do that "Sketch" how much will be really usable in the larger world when I am through.

Any time spent learning C/C++ is well spent, the knowledge (and most or even all of the code) is portable to just about every platform known to man these days.

As for using the VS plugin, I tried the first release and it worked out of the box, since then I believe it's got better. Personally I don't know how anyone can use the Arduino IDE for anything more that a 100-line program or a quick syntax check on a forum post, although I know many (most?) people are happy with it.

Once you've used a real IDE there's no going back IMO.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

This was my intent. I have  no intent to indicate that in any way am I ungrateful for the work as a whole. The IDE is a little quirky but I've paid hundreds of dollars for software that didn't do as much, as well as this IDE does. There are however some small things that could be better. As I pointed out I would love to change the font to a non serif type and to have line numbers.
Perhaps a little history is in order here. I started writing code with Quick Basic (PDS 7.1) early in my engineering career. I learned the '51 instruction set well enough to fix some code we shopped out. Later I went to the Pic and I used Parallax's Spasm because it was so similar to what I already knew and then I changed over to the Microchip IDE and developed some code for a PIC16C54 which got moved to a '57 (Gawd Awful chip with banked memory) C compilers were Very expensive and didn't work with the cheap small Proc's I needed for the job and they were even then notorious for producing somewhat bloated code compared to the assembler.
My point (finally) is that I learn best and fastest when I use the best tools around.
There are there are boundaries associated with both the chip and the code. There is a whole big part of C++ that I can never learn on an Arduino and this is my interest in code studio and the Arduino plugin. I intend to learn the boundaries as well as C++ I hope to graduate in both directions, Embedded controllers and Windows/Linux applications.
I am not going to be able to do that if I am restricted to the Arduino environment. This is my interest in the Visual Studio program. I can Study C++ in both environments in an easier, more complete manner, I feel.In the short 6 month's since March of this year I have a working GPS clock, a BMP085 Barometer and a working DHT22 humidity sensor, this from a cold start with C++. I follow the General Electronics section and contribute what I can, when I can and avidly read this section. The thread on Malloc was interesting as well as several others.
I've learned a lot but I need to learn more. I hope soon to be able to follow Prata's C++ Primer 6 on computer as well as in print and begin to make sense of this thing with the help of this forum...

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

michael_x

Quote
This time spent here is supposed to be my retirement and I find myself working as hard if not harder now as when I retired

I'm short before retirement, and I fear my wife will be very disappointed when she finds out that I'm looking forward spending my "spare" time here and with that useless piece of programmable electronics.

If you want to promote to 4th grade, and got VisualStudio already, sure, give it a serious try.
There will be more for you than just changing the font size. 

Nick Gammon


There is a whole big part of C++ that I can never learn on an Arduino and this is my interest in code studio and the Arduino plugin.


I don't get this bit. The Arduino IDE does not limit your use of C++.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Nick Gammon

I don't personally think the IDE limits you. I've used Visual Studio in the past for my fairly extensive C++ development, and for programs that are, like, over 3 Mb in size, yes you need good organization.

But for 32 Kb of code? Not so certain that the IDE limits you there. The IDE is basically a text editor. It doesn't really add or remove from the underlying compiler which is the avr-gcc compiler.

I don't think the font, the font size, or the colour of the text is really the issue standing between you and a nice working project.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

dxw00d

You can change the font. Edit the preferences file and change the editor.font (or editor.font.macosx) line.

For example:
Code: [Select]
editor.font=Lucida Console,plain,12

No I didn't mean to imply that it was. What I have found is that If I get into a richer environment I learn more. The examples don't make a lot of sense sometimes and I "think" that If I had a chance to 'play' with them they might make more sense. The Book sort of "mothers" you in taking you through the code. The Arduino doesn't and at least for me finding out what I did or didn't do becomes a great deal more difficult with the Arduino IDE... Line numbers would be great. I had a missing semicolon on a variable declaration before a large comment block for example and the compiler marked a comment as the offending line. It would make some things easier I think. Changing the font is a sop to my age and vanity and the idea that I don't want glasses again, I wore them for 50 years before I got cataracts and had my lenses replaced, Serif fonts are hard for me to see. After all the good comments I will give it a try. Thank you one and all for the great response.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Thank you. Are there any restrictions... like not apparently using TT fonts?

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

dxw00d

I don't think so. I tried TT fonts, and they seemed to work. I only used Lucida Console as an example because it's a fixed width font, and I don't like variable width fonts for code editing.

GREAT thank you for taking the time to add some good advice... Now where do I enable line numbers? <BFG>

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

AWOL

Quote
Now where do I enable line numbers?

The current one is displayed bottom left of the IDE.

Besides, line numbers are just so....FORTRAN.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Nick Gammon

http://code.google.com/p/arduino/issues/detail?id=976
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Thank you one and all I managed the font change and it is really nice compared to the Times New Roman Serif font. Much cleaner and crisper. Nick I thank you about the change request you pointed me to.
If I had to try to explain my IDE 'disenchantment' it would be the sparse environment.
As I tried to explain... sometimes more bells and whistles are better, simply because they encourage experimentation, more so than the nice albeit plain Vanilla environment that the Arduino IDE does and it gives me a chance to learn to write "regular C++" instead of includes, function prototypes, setup() and loop()...  Not that I now can do any of those well... Yet.
The Arduino is a teaching environment more than a really great programmable "Brick". It is a very fine teaching environment and while I don't think I have exhausted, by any means the examples and the other training tools.
The C++ books I read, Prata's Primers, 5&6, Prats's C Primer, Cplusplus. I like C++ In a Nutshell. All the other fine free and not so free books are difficult to experiment with in order to see how the examples work and how to 'work' them.
One day I would like to write things that are more platform independent and the day I don't feel is when I am finally an Arduino Wizard. In other words much of my learning will be done on the Arduino but now I have a chance to 'dabble' in a wider playground as well and perhaps be able to apply my learning to better Arduino code as well as having the chance to possibly write code for other platforms.
I have that Renasys RL78 challenge board and I have both the STM32 discovery board as well as the TI Launchpad MSP430 offering. I bought these parts because 1. they were inexpensive (except the renasys) and 2. because they are a good (I think) stepping stone to more advanced and easier to implement complex solutions.
There are things I would like to do that involve mice and keyboards and while they are do-able with other Arduino Variants they still use the (so far) 8 bit chips.
The Duo from what little I can see is intended to overcome some of those issues... But it is for the most part a fiction on paper... So far.
I am led to those conclusions by the dearth of real information.
My other reason is that there are things like the Chipkit, the Leonardo (alluded to above) and several other offerings that look more like garage adaptations of the basic Arduino environment, neither here nor there and not quite as 'mainstream' as the STM or the Renasys or for that manner the Ti .
The Arduino adaptations are just that, adaptations. The STM and it's ilk  are intended for one purpose and one only. That is to sell product IC in 10's of thousands of pieces. The same is true of the other products.
In many ways the Arduino is a Basic Stamp on steroids. It includes all or nearly all the things left out of the Stamp. One failing of the stamp is it's speed and the other is it's totally messed up (The word I wanted to use starts with an "F") 2K X 12 banked memory map with 4, 512 byte "banks" of ram for program area. I used those chips 10 years ago and never again.
The Arduino uses C++ and it is a free extensible and good implementation of the language, where the Stamp used a crippled basic really only good for simple products, It won't work with one wire, SPI IIC and the available program area could get lost in the eeprom area of an Uno. The final factor for me was trying to read a DH11... The Picaxe products are a simpler implementation more suited to 6th graders, Great in the 'variety' and arguably better than the Stamp but again because of the interpreted environment crippled, Even @ 64 mhz (16 mhz clock and a 4X pll) the device isn't fast enough. They do make useful data collection devices where an Uno would be overkill and small process controllers as well under the same conditions.
The Arduino is a great beginning but for the reasons that make it a teaching device, a powerful teaching device but still primarily a teaching device
I am nowhere near exhausting the learning opportunities presented by the Arduino and it won't be anytime soon that I am. However it would make the learning better If I could in parallel be able to use the "Big Boys" books to better advantage and to know how it is done on both and the differences of both. An example might well be writing an interface for the Arduino and the PC, something that certainly can't be done on a Mega, With a mega as a subject but not to code a windows interface on.
This would allow me to expand the Arduino's capabilities... When I learn enough to do it...
There is always the thought that 1. It's Free and from the documentation well suited to many tasks that the basic IDE simply isn't. and 2. It is a gateway into PC programming as well. All Strictly IMO and very much subject to whatever critiques that are created by both sides of the argument.

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Graynomad

Quote
I am led to those conclusions by the dearth of real information.

Aren't we all, there hasn't been a thread about the Due for weeks now, I think people are resigned to "whatever".

Quote
2K X 12 banked memory map with 4, 512 byte "banks" of ram for program area. I used those chips 10 years ago and never again.

If you really want a clean architecture go ARM.

Re the use of a real IDE (I'm talking Eclipse here but they all have similar features), there are a lot of things I like but for example the line

for (int i = 0; i < SOME_CONSTANT; i++)

I just mouse over SOME_CONSTANT to see the definition, I don't have to go looking for it in one of 30 include files. If I F3 the editor opens the appropriate file and places the cursor at the right line. Even if it's buried deep in the core libraries somewhere.

Same goes for functions, macros etc. With functions you get the first X lines of the function in a popup, so in this line

swTimerAttachCallback (led_timer, LEDon);

I put the mouse on the function name and get

Code: [Select]
/////////////////////////////////////////////////////////////////////
//
// Function name: swTimerAttachCallback
//
// Description: Set the callback function for a timer.
//
// Parameters: swTimer * t, pointer to the timer
// void (*callback_func)(swTimer *), pointer to
// the timer's callback function
//
// Returned value: Hardcoded to NOERROR at present
//
// Errors raised: ERR_BAD_OBJECT if the t parameter pointed
// to a corrupt structure.
//
// Example: myFunc () {
// // do this when timer 1 times out
// }
// ...
// swTimerAttachCallback (1, myFunc);
//
// Notes: Executes the FATAL macro if the t parameter
// pointed to a corrupt structure.
//


Hit F2 and I can see all of the function in a popup window.

Can't remember the exact function name or parameters?, start typing and hit ^SPACE, all functions that match the characters entered so far pop up in a window, select one and you get a list of parameters and their types.

This sort of thing makes life a lot easier.

Now let's look at part of an Arduino core file

Code: [Select]
#if defined(TCCR0A) && defined(WGM01)
sbi(TCCR0A, WGM01);
sbi(TCCR0A, WGM00);
#endif 

// set timer 0 prescale factor to 64
#if defined(__AVR_ATmega128__)
// CPU specific: different values for the ATmega128
sbi(TCCR0, CS02);
#elif defined(TCCR0) && defined(CS01) && defined(CS00)
// this combination is for the standard atmega8
sbi(TCCR0, CS01);
sbi(TCCR0, CS00);
#elif defined(TCCR0B) && defined(CS01) && defined(CS00)
// this combination is for the standard 168/328/1280/2560
sbi(TCCR0B, CS01);
sbi(TCCR0B, CS00);
#elif defined(TCCR0A) && defined(CS01) && defined(CS00)
// this combination is for the __AVR_ATmega645__ series
sbi(TCCR0A, CS01);
sbi(TCCR0A, CS00);
#else
#error Timer 0 prescale factor 64 not set correctly
#endif

// enable timer 0 overflow interrupt
#if defined(TIMSK) && defined(TOIE0)
sbi(TIMSK, TOIE0);
#elif defined(TIMSK0) && defined(TOIE0)
sbi(TIMSK0, TOIE0);
#else
#error Timer 0 overflow interrupt not set correctly
#endif


Quickly, tell me which of the above code is actually compiled. You have no idea without hunting for a dozen #defines using grep or whatever. In a real IDE the code that is def'd out is also greyed out. It's a no-brainer.

I know people do large projects in the Arduino IDE, what I don't know is why.

______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

Learning is C++ is hard enough and especially hard with a minimal IDE on a minimal platform...
I read 2 hours every morning and some of what I learn I can't really relate to as I can't use it
Strings and other things that take large pieces of ram.
I think that I am going to install the Visual Studio and the Arduino plugin.
Off Topic Really but what of that "Enhanced" IDE installer IDE Ver 1.01C?
I was curious about that as well.
I thought there were some fixes for some of the issues with the basic Arduino IDE???

Doc
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Go Up