Need suggestions setting up environment for learning C

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The reason for this question is I don't want to BREAK my setup!  I had a difficult time getting Atmel Studio up and running.  I even uninstalled Arduino from this system because I thought it may have been responsible for the difficulties.

 

So, I know I could install MinGW or similar, which isn't a problem, but if I do, I want to know it won't break anything.  My end goal is this:

 

Ideally, I would like a C programming environment where I could write simple code snippets for testing and learning C, then hit "Run" and have it run as a runtime program like Visual Studio does (or used to).  I have limited harddrive space on my laptop so smaller is better.  I really don't want to sign up for Visual Studio.  I'm not looking for visual forms or anything like that, just an output window (console?) for testing my code snippets.  I see Atmel Studio has an output window but it looks like it only outputs from percepiotrace.  I sometimes spend 20 minutes or more searching the web for answers when if I only had the above setup, I could have pounded out a couple lines of code and found the answer in a tenth the time.

 

One problem is I've never written a "make file" and don't know where to start unless its at the beginning, then I could just follow any of a myriad tutorials online.  I have no problem with that... I just don't want to somehow screw up a driver or environment variable (or worse) that will cause problems with Atmel Studio.  If there's a way to use Atmel Studio without setting a target device AND it has an output window for print statements, that would be great, but I can't find a way to do that.

 

What's the best path?

Last Edited: Thu. Jul 21, 2016 - 09:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are just looking for console output to test code snippets, how about C++ Shell online?

http://cpp.sh

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jamison wrote:

If you are just looking for console output to test code snippets, how about C++ Shell online?

http://cpp.sh

 

That'll work!  Nothing to install.  yes

 

<edit> though it is c++ and boy is the backspace in a browser annoying.  I've lost my little snippet like 4 times in the past 10 minutes.

Last Edited: Thu. Jul 21, 2016 - 08:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would have thought the Arduino setup would have been easy to use???  There is nothing about it that prevents you from writting simple C programs and running them on the UNO.

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
stack gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

I would have thought the Arduino setup would have been easy to use???  There is nothing about it that prevents you from writting simple C programs and running them on the UNO.

 

 

 

True, but I don't have Arduino on my AVR computer.  Had problems getting Atmel Studio to run so I uninstalled it.  Plus, it seems a little silly to have to connect a UNO and burn to a board so I can see output back on the serial console.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Pelles C" (Link) is a free C compiler that runs on Windows. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jamison, do you use that site?  cpp.sh?  I get weird outputs sometimes... like "What's your name?"  "Should I quit?"... like someone is on the other end chatting with me but if I respond, there is no counter response.
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have found that you can use the Arduino IDE and the Studio IDE on the same machine with no issue.  But I noticed that if you install the Arduino extension to Studio you start getting popups every time you launch Studio asking you to buy Visual Studio.  Changing the OPTIONS setting regarding selling me stuff does not solve the problem.  removing the Arduino Extension from Studio does.

 

I also recommend PellesC

 

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Chuck99... the big question is, "if I install it, is there any possibility that the install can break Atmel Studio?"  My impression is that Atmel Studio doesn't always play well with other software.  Albeit that impression comes from anecdotes I've read online.  It may only have to do with the Jungo driver or something?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The first thing you need to learn is that this forum is for Studio bugs ONLY, I'll move the thread.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

chipz wrote:
Hi Chuck99... the big question is, "if I install it, is there any possibility that the install can break Atmel Studio?"

Just about anything can break anything.

 

I have PellesC on my machine and I have Studio, AND I have MPLAB, AND I have other things and they all play nicely.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Easy" ways to get a C dev system for host development (none of which should impact existing software):

 

1) as already mentioned: Pelles C: http://www.pellesc.de/ or http://www.smorgasbordet.com/pel... (not entirely sure why there are 2 vitually identical sites??)

 

2) Code::Blocks with MinGW: http://www.codeblocks.org/downlo... (it's the "codeblocks-16.01mingw-setup.exe" you would want there)

 

3) Just use Linux! Either install a dual boot on you PC and have the option of either Linux or Windows or use VirtualBox or VMWare to set up a virtual machine and install Linux into it so you can run both Windows and Linux at the same time. Note however that you would probably want to set aside at least 10GB for the "virtual drive" in this case so this could be a space eater. (but you get a powerful operating system in return and it natively contains the GCC compiler)

 

I listed those as 1, 2, 3 - the order has no significance. In fact if I had the disk space I'd opt for (3) but installing an entire operating system just to get access to a C compiler might be considered "over kill" by some!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

If you're serious, you want to learn Linux anyways.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

chipz wrote:

Jamison, do you use that site?  cpp.sh?  I get weird outputs sometimes... like "What's your name?"  "Should I quit?"... like someone is on the other end chatting with me but if I respond, there is no counter response.
 

On a daily basis, I'm surrounded by a computer with a compiler on it... so no, I do not use it. It came up first in Google result as I had seen another one similar to it and thought it might help ya. I gave it a trial run of about 4-5 compiles before I posted the link to you. It seemed accurate and good enough for quick snippets. Didn't notice any weird question... But I wouldn't be surprised if someone is watching! Whether it's on that site or through your camera phone... hehe

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I downloaded Pelles C.  I like that it's relatively lightweight super easy install.  I tried code::blocks a year or so ago for evaluation.  There were things I liked, but a lot I didn't like.  I removed it.

 

I'm intrigued by Pelles' windows components.  I've never seen anything like that beyond Visual Studio.  Though it's not visual, its my first time seeing a path to writing windows apps outside of VS.

 

I'm not real crazy about having to switch to Linux.  I've looked into in the past and decided the learning curve just wasn't worth it.  The reason I went PC 28 years ago is because it was the most widely available, most software available and the one that was supported most.  I grew up in the era of VHS vs Betavision (and later laserdisc HA!).  Beta was clearly a better platform but VHS being the defacto standard meant more available movies.  Same with OS's.  However, I seriously doubt I will ever upgrade to Win10.  When my Win 7 platforms become too much of a security liability, I'll probably be forced to switch at least a few.

 

I don't know how "serious" (to quote previous poster) I am about programming C (or AVR for that matter) but I'm closer to the end of my career days than I am the beginning.  You start looking at how you spend your time a little differently... choosing based more on immediate benefit than what the "investment" will mean to your future.  Linux takes an incredible investment in time, from what I've seen.

 

<edit> forgot to add... I noticed Pelles C would throw an error when I try to execute sometimes.  Seemed like an intermittent problem at first, but then I noticed that it only occurred after a quick edit (even just adding or deleting a white space) AND hitting "execute" within a minute.  Wait a full minute and it will usually compile and execute.  I kinda remember a similar thing happening with Visual Studio (been a few years) but I don't recall how I resolved it, if ever I did.  Generally, edits are longer than a minute, so no big problem.  Otherwise, I like it.

Last Edited: Fri. Jul 22, 2016 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

chipz wrote:
I'm intrigued by Pelles' windows components. I've never seen anything like that beyond Visual Studio. Though it's not visual, its my first time seeing a path to writing windows apps outside of VS.

Possibly better options for you if you want to do that are to (a) explore Python rather than C/C++ or (b) explore QT5 (and QT5 Creator). Both of those allow you to easily create GUI apps and they have the advantage that they work the same whatever OS you build them for (Linux or Windows and probably OSX too).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One doesn't have to 'switch' to Linux. As Supernaught sang 'I like it both ways'. The learning curve can't be too great if there's legions of spotty kids with their raspberry pi's tapping out command line stuff. There's a whole new world out there to explore.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tapping out command line stuff. There's a whole new world

Back to the future 1970s.....

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

explore Python rather than C/C++

Is there an IDE with debugger for Python on Windows (or other OSes)?

One of the problems I'm having with modern languages is the relatively unfamiliar development process (no EMACS mode, no gdb, no make.)  But I'm pretty ready to give up "bare C" when trying to do GUI stuff.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In your "Synaptic Package Manager" under Ubuntu there is "PIDA".

 

PIDA is the Python Integrated Development Application.
 It is an IDE (integrated development environment) written
in Python (http://www.python.org/) and the GTK+
(http://www.pygtk.org/) graphical toolkit.

Pida is an IDE, but one that is slightly different from
other IDEs. Rather than attempting to write a set of
development tools  of its own, Pida uses tools that the
developer has available. In this regards Pida can be used as
a framework for putting together your own bespoke IDE.

Although still a young application, Pida can already boast
a huge number of features because of the power of some of
the tools it integrates. For example features such as code completion
and syntax highlighting are well implemented in Pida's integrated editors
far better than any editor built for a commercial IDE. Pida currently features:
Full code editing (syntax highlighting, code completion, automatic indenting,
block commenting etc) Project management, version control management,
Python debugger and profiler, GTK+ graphical user interface building and
rapid application design, Pastebin integration.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:
Is there an IDE with debugger for Python on Windows (or other OSes)?
Most Microsoft Visual Studio including Community.

Microsoft

Visual Studio Online

Debug, Profile, and Diagnose Code

https://www.visualstudio.com/features/debugging-and-diagnostics-vs

(search for Python)

https://www.visualstudio.com/products/compare-visual-studio-2015-products-vs 

 

In general :

https://wiki.python.org/moin/DebuggingWithGdb

 


VisualGDB

Version History

http://visualgdb.com/history/

...

21 Feb 2016

  v5.1 ...
Added support for debugging Python code on Linux, MinGW and Cygwin

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had no idea you could debug python with gdb (it's interpreted, isn't it?)  Huh!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I started with Python I spent about a week exploring Python IDEs. In the end I went with Pycharm which is utterly brilliant. Possibly my favourite IDE for any language / processor ever. What's more, it's implemented in Java so versions operate virtually identically whether you use Linux or Windows. The real-time syntax checking is amazing and it even tells you if you use "foo = foo + 1" that you'd be better using "foo += 1" etc. So it teaches you stuff as you type. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe, regarding GUI, is better to test the IDE's which offers interface to PyQT and QT, preferably also easy access to the graphical interface designer:

 

- Eric IDE,

- Spyder3,

- Ninja IDE.

 

All under Ubuntu, first two with Debug capability. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Depends if you want to use both Python and QT. I'd usually use "either/or". I'd either write a "quick and dirty" solution for something in Python and to sprink a bit of GUI on it I'd just use the multi-platform lib that comes with Python - that is Tkinter. Or if I wanted to write an extensive multi-platform app using QT5 I'd probably use QTCreator and C++.