Expand the CircuitPython Expectations page to include more FAQs. If there are other things you are finding people constantly asking, please comment on this issue! Thanks!
Potentially combine with CircuitPython Built-Ins page.
Needed additions:
[x] Lack of interrupts (IRQs)
[x] WINC1500 and Feather M0 support
[x] Heap memory usage
[x] MemoryError and how to avoid it
[x] AVR CP support
[x] Difference between Express and non-Express boards
[x] Limits on ints and floats on M0 boards
[x] ESP32 support
[x] Switching between Arduino and CircuitPython
[x] Things to watch out for! (From CircuitPython Built-Ins)
people ask about WINC1500 + Feather M0 support - it wont fit into M0 flash :/
@kattni - check discord and hackchat logs for other common Qs :)
for M0, at least, we store numbers in 30 bits. that means there's a limit/range on both ints (0 to 0x7FFFFFF ) and floats https://github.com/adafruit/circuitpython/issues/572
(check me @dhalbert )
Integers are 31 bits signed. Floats are 30 bits (the bottom two mantissa bits are dropped). It's a variable encoding: the lowest bit == 1 means integer; when == 0, the second lowest bit helps specify the kind of object. When two encoding bits are used, the 32-bit value is a 30-bit float or a 4-byte-aligned object pointer or a "qstr" (a static string pointer). See comment below from py/obj.h. There are multiple alternative encodings provided by MicroPython. For atmel-samd and esp8266, we use MICROPY_OBJ_REPR_C. A few ports use other representations.
// A MicroPython object is a machine word having the following form (called R):
// - iiiiiiii iiiiiiii iiiiiiii iiiiiii1 small int with 31-bit signed value
// - 01111111 1qqqqqqq qqqqqqqq qqqqq110 str with 20-bit qstr value
// - s1111111 10000000 00000000 00000010 +/- inf
// - s1111111 1xxxxxxx xxxxxxxx xxxxx010 nan, x != 0
// - seeeeeee efffffff ffffffff ffffff10 30-bit fp, e != 0xff
// - pppppppp pppppppp pppppppp pppppp00 ptr (4 byte alignment)
// Str and float stored as O = R + 0x80800000, retrieved as R = O - 0x80800000.
// This makes strs easier to encode/decode as they have zeros in the top 9 bits.
// This scheme only works with 32-bit word size and float enabled.
#define MICROPY_OBJ_REPR_C (2)
Totally flaked on adding this after the meeting this week...
ESP32: When is it coming to CircuitPython?
The summarized standard answer I've seen, and given, is that we're not currently developing for it and will pull from MicroPython once their dev is complete. Also, we have no ETA.
Memory Error, and how to avoid it:
https://github.com/adafruit/circuitpython/issues/569#issuecomment-367506037
Not sure if this qualifies as something that is asked constantly, but this page has a couple issues that I ran into when trying to read serial data with the CircuitPython on the Circuit Playground Express (CPX): https://github.com/AllwineDesigns/CircuitPythonSerialGlitchiness
Things that I think are worth noting on an FAQ or troubleshooting page are:
Include the following from CircuitPython Built-Ins (some of this is already included):
Things to watch out for!
How about an acronym decoder ring, with links.
CP = CircuitPython (link to welcome to guide)
CPC = Circuit Playground Classic (link to PID 3000)
CPX = Circuit Playground Express (link to PID 3333)
@kattni Mind doing this soon so we can close this issue?
@tannewt Yep I'll get it on my list.
I've begun working on this. I will be pinging various people for help with their suggestions if needed.
This is ready to go! We can always add more as more common questions or important information come up.
reviewed and this is gooood!