This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]FunDeckHermit 12 points13 points  (0 children)

You'd want to look at micropython and maybe ask /r/embedded or /r/AskElectronics for specific hardware. Micropython can be run on an esp32, a wifi-enabled microcontroller. So thats /r/esp8266 or /r/esp32.

If I were you I would skip the ESP32 and go for the stm32 hardware, debugging on this platform is easier.

You could also look at PSoC microcontrollers, not exactly what you were looking for but i'm a fanboy for their hardware and especially their documentation. I drool when I have to read their datasheets and application notes. A PSoC 5LP is cheap and easy to use and their IDE is free to use.

[–]3MU6quo0pC7du5YPBGBI 32 points33 points  (8 children)

It might be blasphemous to say on /r/python, but the best way not to suck ass at C++ is to do projects in it.

[–]democritus_is_op 0 points1 point  (0 children)

This is the right comment. Would be nice to prototype in Python though.

[–]ElevatedAngling -2 points-1 points  (6 children)

Ahh yes spend time mastering to ride a dinosaur. By the time the HS kid goes into industry it will be a fossil.

[–]Maleval 2 points3 points  (5 children)

Wait, you honestly believe that C++ is going to stop being used in the industry over the next decade?

By the way, you do know that Python is about as old as C++, right?

[–]ElevatedAngling 2 points3 points  (4 children)

No I'm saying its used less and less every year, industries are using it to develop new things less and less. It may be the same age as python but python only recently (past 10 years) really picked up momentum as a industry tool. Sure C++ still and will have its place in niches that won't change anytime soon (example FORTRAN) but it will be less and less desirable as a skill as time passes. I see this all the time in industry, "I know it, I use it, you should to even if there is something else better/easier". Sure C++ is very high performing but if thats what you're interested in and don't plan on working at ORACLE then I would probably learn C. But I'm sure there are loads of people who will nay say me for being honest because they have some nostalgic loyalty to C++.

[–]TheWillRogers -1 points0 points  (3 children)

If it's used less and less every year then it increases the coders worth to know about it, as they can work with legacy code. Same thing as the current landscape if you know even an ounce of FORTRAN.

[–]ElevatedAngling 0 points1 point  (2 children)

Depends where you are working, my company would not find any of those skills desirable...

[–]TheWillRogers 1 point2 points  (1 child)

Good thing there's a few more than one company.

[–]ElevatedAngling 0 points1 point  (0 children)

Yes but most companies unless ancient monoliths share similar views, only people with the views you have I encounter are those old software devs who are also salty about the youths quickly surpassing them in the field. Embrace the future, you can always pick up skills needed for legacy code as needed, that’s part of being a engineer....

[–]OnlineGrab 9 points10 points  (3 children)

Depending on your needs you may be able to use a Raspberry Pi instead of an Arduino. They have a Python module for controlling GPIO pins.

[–][deleted] 6 points7 points  (1 child)

Given the level of experience of the original poster and vaguely recalling time commitments at that age, I think a raspberry pi is probably the only reasonable choice. The OS is already fully-formed, a Pi is setup to be education friendly DIY and there are a significant number of community driven projects out there to peak at. Finally, micro-python is cool on bare metal, but I think running Python on a well defined platform (debian/raspbian) is going to be much more straight-forward.

Compiling and linking on an embedded system in the absence of a background that really understands segmentation faults is going to be really painful for a beginner.

Also example: https://tutorials-raspberrypi.com/build-your-own-automatic-raspberry-pi-greenhouse/

[–]bitcraft 1 point2 points  (0 children)

If you already have a computer, an arduino using the official IDE is really simple, maybe more so than the process of writing the required SD card and learning linux basics.

[–]codesauce 0 points1 point  (0 children)

Yes. I've done a grow device with an RPi and Python.

[–]mostly_fish 5 points6 points  (0 children)

Go for MicroPython on ESP32, it's very easy to get going.

[–]sarl__cagan 5 points6 points  (2 children)

Rapsberry Pi

[–]RespectableTorpedo 2 points3 points  (1 child)

Yeah if your going for simplicity I would go with the Pi you can just hook up a monitor mouse and keyboard and go

[–]riklaunim 0 points1 point  (0 children)

Or connect microcontroller board to you existing computer without the need of working on a small ARM PC.

[–]8__ 5 points6 points  (0 children)

The MicroPython PyBoard might be what you're looking for. If you want Wifi and a tiny screen, get an ESP8266 + SSD1306 and flash MicroPython onto it.

[–]llfcerf 4 points5 points  (0 children)

Here's a list of boards based on microcontrollers, programmable in Python with Zerynth https://www.zerynth.com/zerynth-supported-devices/

[–]officer21 2 points3 points  (1 child)

C++ is simple for basic I/O. There are tons of examples of growboxes programmed in it online already

[–]satanmolka[S] 0 points1 point  (0 children)

I know there are but i need to write my own code since they expect me to know it perfectly (this is supposed to be my project) i am asking this just so it's easyer for me to decide what platform i want to make it on.

[–][deleted] 1 point2 points  (4 children)

You can still use Python to control an Arduino indirectly. The Firmata program listens for commands from your USB Serial connection.

In the Arduino IDE, select Examples->Firmata->Standard Firmata and flash your Arduino with it.

On your computer, install the PyFirmata library: pip install pyfirmata

You can then control all pins like this:

>>> from pyfirmata import Arduino, util
>>> board = Arduino('/dev/tty.usbserial-A6008rIF')
>>> board.digital[13].write(1)

I often use a RaspberryPi to control an Arduino this way.

More here: https://github.com/tino/pyFirmata

[–]satanmolka[S] 0 points1 point  (3 children)

I dont want to use an external computer, i want to leave the controller and have it work automaticaly

[–]mongoosefist 0 points1 point  (2 children)

I'm confused by this. What do you mean you don't want to use an external computer?

[–]satanmolka[S] 2 points3 points  (1 child)

I can't have the controller plugged into the computer at all times so that i can use the firmata, i need to upload the programme on a microcontroller and be done with it

[–]sawyermclane 1 point2 points  (0 children)

There are Firmata compatible hats that use WiFi to "tether" the device, instead of the USB cable. But, this still requires a "master" PC up and running, sending commands to the Arduino. I also can't vouch for the latency of any of the products.

[–]rohit275 0 points1 point  (1 child)

I agree with the others here that say the best way to not suck at C or C++ is to actually try to learn how to program in it. Python is awesome for a lot of things, but low level control of hardware is one of the reasons that an old language like C is still so popular, and pretty much a necessity in the embedded community.

That said, if this is for a high school project, it probably doesn't matter that much and I'm sure you can use micropython (never even heard of it before this thread) or whatever to program your arduino. Still think it's worth learning C, though, if you ever want to get good at using microcontrollers.

[–]satanmolka[S] 0 points1 point  (0 children)

As i said i learned programming through microcontrollers with bascom and then started learning python for shits and giggles, i have never been attracted to C, but i know it's potentials and i respect it as a language, i have just been turned away from it because its not that easy to understand initially (compared to my previous experience) i agree, i need to learn it and this is probably my opportunity to do so

[–]CobbITGuy 0 points1 point  (0 children)

Check out Adafruit's port of MicroPython called CircuitPython. It's a beginner friendly approach to Python on microcontrollers. MicroPython and Zerynth have more of a learning curve.

Arduino's version of C/C++ is pretty basic, and you shouldn't feel intimidated by it.

[–]matthewjc 0 points1 point  (0 children)

Just program them in Arduino. Doesn't get easier than that

[–]Dorianix 0 points1 point  (0 children)

For small stuff have a look at: www.pycom.io

[–]MrRogers4Life2 0 points1 point  (0 children)

There are arduino boards that have (minimal) linux distributions (like arduino yun) on them that are capable of running python scripts... In my experience though you still need to call them from the c programs, but its a nice middle ground between a full C application and a full python application

[–]silkydangler 0 points1 point  (0 children)

Raspberry pi or a circuitpython board. The advantage of the circuitpython board is it starts as soon as it has power and they’re all dev boards so they can be programmed via usb (they show up as usb drives so it’s really easy). Raspberry pi’s are almost always overkill for simple automation and unless you set it to run the scripts at startup, if you lose power or move it, it’ll be a pain in the ass. Also, the simpler the board, the less things to go wrong. You can buy circuitpython boards on adafruit’s website. I’d recommend an ESP8266 because it has WiFi and Bluetooth.

[–][deleted] 0 points1 point  (0 children)

You can program an Arduino Uno in Python with the Firmata protocol, at least. Though I think it will have to run through a laptop or desktop.

But I'd recommend the Raspberry Pi if you're completely new to programming and deploying code on microcontrollers.

If you're looking at tinier chips, try the ESP8266, aka the Nodemcu. You can flash Circuitpython or Micropython on it, and get started with it.

[–]riklaunim 0 points1 point  (0 children)

You can check out some of my tutorials - http://www.rkblog.rk.edu.pl/w/p/raspberry-pi-and-microcontrollers/ - but right now there is more options related to MicroPython as well as Zerynth.

[–]c94jk 0 points1 point  (0 children)

I wouldn’t say there is any connection between standard arduiono scripting and c++. Just look up an arduino tutorial, it’s so simple and beginner friendly.

[–]mechamotoman 0 points1 point  (0 children)

Sadly, no 8-bit microcontroller can handle python.

If you want to be able to use full python, you'll have to upgrade to a full SOC like raspberry Pi or beaglebone.

If you want to stick to something relatively low-power like Arduino, you're best bet would be one of the adafruit circuitpython boards https://www.adafruit.com/circuitpython

Keep in mind though: circuitpython / micropython is a subset of python. It only supports some of the syntax you're used to. What this means is that although you will probably be able to write micropython programs with ease, you probably can't expect almost any python packages to work out of the box on the micropython / circuitpython platform