Need expert advice for MCU Programming.

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
avengerman14s
 
Posts: 3
Joined: Tue Mar 24, 2015 10:04 pm

Need expert advice for MCU Programming.

Post by avengerman14s »

Hello,
I’m a physically and mentally disabled veteran (TBI & Severe Depression) suffered in combat. I need help with programming languages, prior to my injuries I made a part time living from writing interface software in Pascal, Visual Basic, SQL/ODBC. Now with my disabilities i cannot learn needed C/C++ or Assembly. I have spent hundreds on ATMELs, PICs, and ARMs and just about every “Learning” book out there. During this time I purchased both an Espruino 1.4, MicroPython 1.1 and recently some ADAFRUIT Circuit Python boards. I haven’t tried them yet because of my stubbornness to get a working C program going, but as of tonight I’m done with C.

Now my questions are what would you say would be the best high level language to use? JavaScript or Python for now? My main focus is on using IC2, SPI, and Graphic/text Displays. My main hobby is Radio, both Commercial and HAM so my projects would be geared in that direction. I love building new things and giving them to friends.

If I can do that then maybe I’ll spend the money for commercial Pascal or Basic Compilers for the AVRs and PICs.

Lots of personal info but I really need good advice and what better place than here.

Thanks,

Jim

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Need expert advice for MCU Programming.

Post by adafruit_support_mike »

It's hard to say which would be easier to learn.

Javascript syntax is a lot like C++, but you don't have to put as much effort into dealing with variable types and memory management. It has a simple object-oriented programming model that avoids the most awful parts of C++, and is based on the idea of writing nested functions:

Code: Select all

function myObject {
    this.methodOne = function () {
        //  code for the function
    }
   function private () {
        //  code for the function
    }
    return( this );
}
myObject is a function that returns a pointer to a generic Object (there's only one kind), and that object's .methodOne attribute is a pointer to a function. Adding parentheses executes that function: .methodOne(). The Object doesn't have an attribute for the function named private(), so you can only call that from inside the definition of myObject.

Strictly speaking, Javascript was an ad-hoc language whose name was a publicity stunt aimed at HR departments when "must know Java" was a thing. It's mostly been replaced by ECMAScript, which defines an actual language standard, but most people don't know that. Everyone still calls it Javascript, and the code itself doesn't care.

Python was born the same way as Pascal: as a simple first language for entry level CompSci students. Its biggest quirk is that the whitespace has meaning:

Code: Select all

def func():
    print "this is part of func()"

    print "and so is this"

print "this is not part of func()"
func()
The idea was to force students to learn and use good indenting habits, but programmers who already know other languages tend to find that part a bit annoying.

Every web browser supports Javascript, and most OSes have a Python interpreter these days. You can try both to see which one feels more comfortable without having to spend anything but some time.

In both languages, the code for device communication like I2C and SPI will be bundled as an object, so learning the list of available functions will be different and simpler than learning the language in general.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”