Welcome, Guest
Username: Password: Secret Key Remember me
  • Page:
  • 1
  • 2

TOPIC: C++ Pic Example Code

Re: C++ Pic Example Code 6 years 11 months ago #16344

  • W4GNS
  • W4GNS's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Thanks received: 43
The title says it all, I'm interested in looking at some C++ sample files. Anyone know which way I need to go to see them.
Google was of no help on this.
It does not need to be specific to any one compiler, other than written for PIC's.

Re: C++ Pic Example Code 6 years 11 months ago #12464

  • majenko
  • majenko's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 62
Look at the mpide libraries and core for the chipkit. pic32 c++.

Re: C++ Pic Example Code 6 years 11 months ago #12462

  • W4GNS
  • W4GNS's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Thanks received: 43
Yea I have...... I was hoping to find something else to look at also. Seems like anything Ardunio related is bloated.
Now I'll head over to the Chipkit forum and spend 15 minuted disappoving and banning spammers and there messages.

Re: C++ Pic Example Code 6 years 11 months ago #12463

  • majenko
  • majenko's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 62
Yea I have...... I was hoping to find something else to look at also. Seems like anything Ardunio related is bloated.
You're not wrong there
Now I'll head over to the Chipkit forum and spend 15 minuted disappoving and banning spammers and there messages.
Too many of those

There's no real difference between working with C and working with C++ on a microcontroller. The actual microcontroller interfacing is done in exactly the same way.

The only difference is how you write your program - with C++ you have access to classes. This has nothing whatsoever to do with the environment in which it runs - a PC, a microcontroller, etc.

The only thing to watch is memory fragmentation. C++ tends to use a lot more dynamic memory, as you create and destroy objects, so that on smaller microcontrollers the lack of RAM can become an issue.

As a general rule, keep all your objects static (i.e., MyClass clsvar;, not MyClass *clsvar;) and you'll do OK.

Also, stay away from using the String class - that is known to cause lots of memory problems. There are alternatives though (PString I think a good one is called) that are much more microcontroller friendly.
The following user(s) said Thank You: W4GNS

Re: C++ Pic Example Code 6 years 11 months ago #12467

  • W4GNS
  • W4GNS's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 11
  • Thanks received: 43
Thanks for those comments. That intel is what I don't see in the books and Doc's.

Re: C++ Pic Example Code 6 years 11 months ago #12468

  • jmessina
  • jmessina's Avatar
  • Offline
  • Senior Boarder
  • Posts: 44
  • Thanks received: 189
Bruce Eckel has some excellent books on the ins and outs of C++ (mindviewinc.com).

You can get his "Thinking in C++" series as a free e-download. They're not a language reference, but more of how things work under the hood. Highly recommended.
The following user(s) said Thank You: W4GNS
  • Page:
  • 1
  • 2
Time to create page: 0.276 seconds