Live data from Hacker News

CircuitPython: Programming Hardware in Python

github.com

31–40 of 87 posts

Re: CircuitPython: Programming Hardware in Python

#31
post #2

To be fair, this is really mostly just a rebranded MicroPython...

Support MicroPython. Adafruit has commercial interests - they're building CircuitPython so that people buy their stuff. They're a multi-million dollar corporation, not your mom and pop hobby shop.

Instead of doubling down on MicroPython, Adafruit decided to fork it so they can have the right HALs. They should have made a library, contributed to MicroPython and grown the ecosystem.

Unrelated, I absolutely despise Adafruit customer service - they're demeaning and belittling. I wanted to return items because they were not as described in the pictures - their response was we don't guarantee that. OK. So, you buy stuff off of AliExpress and put a 3x markup and you can't guarantee your supply chain? I now buy all my electronics from DigiKey and Sparkfun.

Re: CircuitPython: Programming Hardware in Python

#33
post #20

Earlier quoted context omitted.

from a programming point of view, all are the same. But if you want to introduce your kid to play with sensors and other stuff, I'd get Playground Blefruit[1] [1]: https://www.adafruit.com/product/4333

any add-ons that you’d recommend? or other stuff for kids playing with Python? maybe an arduino board plus a raspberry pi?

Depends on the level of abstraction you and your kid are willing to get into.

Arduino's are lower-level C/C++ which may be a little more complex than CP, but have much broader library support (better intro to EE/embedded).

RPis are much higher level which could be programmed in any language (better intro to CS/Linux).

Re: CircuitPython: Programming Hardware in Python

#34
post #17

What adafruit board would be best for a beginner (at circuit python but long time developer otherwise) dad and his 8 year old kid?

Circuit Playground is the hardware product that goes hand in hand with CircuitPython, but you’ll probably want to program it using makecode instead.

Version 2 called “Circuit Playground Express” is currently very popular. V1 is obsolete, and there’s a version 3 with Bluetooth. All of them are pre-built with sensors, RGB LEDs, and buttons. This removes a huge hurdle: no soldering required. (Soldering is a fun skill but so is baking bread and cross country hiking — most kids are usually 100% focused on making blinking lights and don’t want to do anything tangential.)

Right now, only version 2 is supported by http://makecode.adafruit.com. makecode is different to CircuitPython: you write your code in JavaScript either using a visual block language or directly in the online JS IDE — both of which are very high quality dev environments with excellent discoverability — and compile everything into a new .UF2 firmware for the device to load each time. The site provides an emulator which is another killer feature. You can go there right now and start programming a board.

CircuitPython on the other hand is itself a pre baked UF2 firmware with a Python interpreter built in. Because your dev tools (runtime, debugger) are now on the device you have less memory to play with and it’s less stable, in my experience. It’s also not immediately obvious how to get things done, compared with the makecode IDE.

With my teenage pupils it was only the makecode JS / block programming that lit up their eyes. The Python tools were too weird. Devices like this are about playfulness and doing weird stuff, and only tangentially about programming, I’ve found.

The killer feature of Circuit Playground was the v2/“Express” (CPE) board with its infrared transmit and receive functionality. Connectivity turns these things from toys into real hacking platforms. I spent the holidays making IR “WiFi” for a pool of 8 CPEs.

The v3 Bluetooth-enabled board sounds great but it won’t be as popular with my classes if it doesn’t support makecode (which it currently does not.)

Re: CircuitPython: Programming Hardware in Python

#36

CircuitPython is a toy language made for running on Adafruit's halloween/cosplaying gadgets. It doesn't even support interrupts. Better use Micropython.

What I don’t understand is: what features of Python encourage its use in embedded systems in the first place? Why not F# or Elixir?

Re: CircuitPython: Programming Hardware in Python

#37
post #17

What adafruit board would be best for a beginner (at circuit python but long time developer otherwise) dad and his 8 year old kid?

Circuit Playground is the hardware product that goes hand in hand with CircuitPython , but you’ll probably want to program it using makecode instead. Version 2 called “Circuit Playground Express” is currently very popular. V1 is obsolete, and there’s a version 3 with Bluetooth. All of them are pre-built with sensors, RGB LEDs, and buttons. This removes a huge hurdle: no soldering required. (Soldering is a fun skill b…

This is a fantastic write-up. Thank you.

Are the details of your classes online anywhere?

Re: CircuitPython: Programming Hardware in Python

#38
post #17

What adafruit board would be best for a beginner (at circuit python but long time developer otherwise) dad and his 8 year old kid?

Great timing. I just showed my kids some of the things you can do with this on the Circuit Playground Bluefruit[1] earlier today. It comes with a lot of sensors and is full of possibilities.

For getting started fast I can't recommend MakeCode[2] enough. It's a web IDE with a compiler and device simulator for programming microcontrollers with blocks or JavaScript/Python.

That said, for more complex projects CircuitPython might be a better choice. There are tons of docs and lots of great examples. It re-runs your code every time you save so you get instant feedback. Also, the vscode-circuitpython[3] plugin has been really nice too.

[1]: https://www.adafruit.com/product/4333

[2]: https://maker.makecode.com

[3]: https://marketplace.visualstudio.com/items?itemName=joedeviv...

Re: CircuitPython: Programming Hardware in Python

#39
post #28

That’s a very misleading headline. I got the impression this was something akin to VHDL or Verilog or SystemC in python. “Programming Hardware” the way it’s used here is pretty much the same as vanilla python, though I suppose a lot in this industry constantly need reminding of that.

I don't think there's any merit to your argument here. If the headline had said "designing hardware circuits", that would be another story entirely. > “Programming Hardware” the way it’s used here is pretty much the same as vanilla python One can only hope so, since the project is a fork of MicroPython. Neither CPython or MicroPython are meant to be a long departure from Python itself.

At a minimum it's unnecessarily vague--hardware is far too broad when it's really just microprocessors. For that matter, in the way they use it, "programming hardware" applies to all code that runs on a computer.

Anyway, my first impression was same as parent's, write Python get hardware.

Re: CircuitPython: Programming Hardware in Python

#40
post #36

CircuitPython is a toy language made for running on Adafruit's halloween/cosplaying gadgets. It doesn't even support interrupts. Better use Micropython.

What I don’t understand is: what features of Python encourage its use in embedded systems in the first place? Why not F# or Elixir?

Python is everywhere in education, F# and Elixir are niche languages.

If you want to use F#, you might get lucky with Meadow boards, yet their focus is mostly getting C# to run on their runtime.

Post reply on HN