Shop OBEX P1 Docs P2 Docs Learn Events
C++ / Hardware Guidance — Parallax Forums

C++ / Hardware Guidance

i am fairly proficient with the C++ programming language and have some basic electronics from a basic stamp set a few years ago but i am looking to get back into the swing combining electronics w/ my C++ skills.

A lot has changed since i was last here, so i am looking for guidance on where to start? Arduino looks kinda cool but so does the propeller series. For someone 'almost' going back to basics what would be the recommendation to pickup for controller board and platform?

I am not to concerned about prefabbed chassis, i can print whatever chassis i need.

Comments

  • If you want to do C++ programming then you will need to go the Arduino direction as all the code on that platform is C++.

    The Propeller series is only C language with some enhancements or SPIN.

    I don't like the hardware on the Arduino front but there are other pieces of hardware out there more capable.

    The Propeller P2 has just come out and there is plenty of opportunity to write drivers and code for that platform.

    I have been using the P1 for sometime now and all my code is in C using the SimpleIDE environment.

    Mike
  • Actually, C++ is supported through PropGCC on P1. On the P2 you can use Eric's RISCV compiler along with his RISCV runtime environment. It supports C++.
  • Micro Python is also written in C, Team Oz has some GCC for P2, not sure about C++ support.

    Enjoy!

    Mike
  • msrobots wrote: »
    Micro Python is also written in C, Team Oz has some GCC for P2, not sure about C++ support.

    Enjoy!

    Mike
    Last I knew they were using the P1 version of PropGCC along with Dave Hein's P1 to P2 translator. Theoretically, it could support C++ although I'm not sure anyone has tried.

  • p2gcc would need a C++ library and startup routines to support C++. I looked at it briefly a year or so ago, but there didn't seem to be much interest in it.
  • Thank you all for all of your responses!

    considering C++ is just C with lots of extra libraries i should be able to get by on C with little change in language structure so it looks like P1 or P2 would be good then? Arduino seems to use something called sketch which is very C like just uses its own library set.

    which do you guys think would be a good starting point P1 or P2? Looking at the Propeller 2 series, wow expensive and not a too robust looking kits, i could still carry over my basic stamp pieces like servos and the like right? (whoops becoming a question machine :) )
  • wyrmhaven wrote: »
    considering C++ is just C with lots of extra libraries i should be able to get by on C with little change in language structure
    Well, I guess that might be true of some C++ code that doesn't make any use of classes or any other C++ specific feature. In general, C++ is a much larger language than C and differs in far more than just what libraries it supports. It has a very different syntax as well. It does, mostly, have C as a subset though.

  • Wuerfel_21Wuerfel_21 Posts: 4,461
    edited 2020-12-23 16:31
    You can generally use C++ anywhere you can use C if you stop it from linking the STL (when using GCC, this is the default for the "gcc" command (as opposed to "g++")). That still nets you features like member functions, templates, auto, etc.

    FlexCC also supports some™ C++ features, notably member functions.
  • Thanks again everyone, hope everyone is having or had a wonderful and Merry Christmas!
Sign In or Register to comment.