Thanks for the great response to the beta everyone! Here is a new release to test. Its got much of the same CircuitPython code as before but has been upgraded to MicroPython 1.8.7 code and GCC 6.2. So, please test it out and let us know what you think.
The Vagrantfile has also been updated to use the new GCC. To updated it, save all the code you care about out of the vm, destroy it, pull and re-up the vm.
Changes:
* Merge in MicroPython 1.8.7
* Switch to GCC 6.2 (arm 2016q4 release)
* Change 0RX style pin names to two names, D0 and RX on some boards.
* Remove the `framebuf`. It made the binaries too large with all of the extra functionality added in 1.8.7.
CircuitPython 0.8.1
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- tannewt
- Posts: 3305
- Joined: Thu Oct 06, 2016 8:48 pm
CircuitPython 0.8.1
From the GitHub release page:
- rrii
- Posts: 11
- Joined: Tue Jan 10, 2017 1:39 pm
Re: CircuitPython 0.8.1
Yes!
I could not take the time and I was unable to answer the previous version of the question.
I am satisfied with good results.
I will try various things.
Thank you :)
Code: Select all
>>> import nativeio as io
>>> import board as pin
>>> led = io.DigitalInOut(pin.D13)
>>> dir(led)
['deinit', '__enter__', '__exit__', 'switch_to_output', 'switch_to_input', 'direction', 'value', 'drive_mode', 'pull', 'Direction', 'DriveMode', 'Pull']
>>> dir(led.direction)
['in', 'out']
I am satisfied with good results.
I will try various things.
Thank you :)
Last edited by rrii on Fri Jan 13, 2017 1:49 pm, edited 1 time in total.
- rrii
- Posts: 11
- Joined: Tue Jan 10, 2017 1:39 pm
Re: CircuitPython 0.8.1
That is a bad usage. I think so,
...what should I do in the following cases?
(Reset? It certainly quickly and surely)
...what should I do in the following cases?
(Reset? It certainly quickly and surely)
Code: Select all
>>> import nativeio as io
>>> import board as pin
>>> led = io.DigitalInOut(pin.D13)
>>> led.deinit()
>>>
>>> io.DigitalInOut(pin.D13)
<DigitalInOut>
>>> led = io.DigitalInOut(pin.D13)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Pin PA17 in use
>>>
- tannewt
- Posts: 3305
- Joined: Thu Oct 06, 2016 8:48 pm
Re: CircuitPython 0.8.1
Reset is the only way. The DigitalInOut object that you didn't save to a variable is still initialized. In saved code I usually use "with" to ensure it gets deinitialized:
Code: Select all
with io.DigitalInOut(pin.D13) as led:
led.value = True
# led automatically deinited
- jerryn
- Posts: 1869
- Joined: Sat Sep 14, 2013 9:05 am
Re: CircuitPython 0.8.1
I built a new image under Vagrant and it loads and executes fine, but the SSD1306 example fails because there is no "framebuf" module.
What happened to framebuf? Do I need to load it from someplace else?
aha! I found your note in atmel-samd/mpconfigport.h
"atmel-samd: Turn off FRAMEBUF because it takes a lot of space."
I guess I need to turn it back on if I want to use the SSD1306. I'll give it shot.
edited-
So much for that idea - It won't fit - 800 bytes too large.
What happened to framebuf? Do I need to load it from someplace else?
aha! I found your note in atmel-samd/mpconfigport.h
"atmel-samd: Turn off FRAMEBUF because it takes a lot of space."
I guess I need to turn it back on if I want to use the SSD1306. I'll give it shot.
edited-
So much for that idea - It won't fit - 800 bytes too large.
- jerryn
- Posts: 1869
- Joined: Sat Sep 14, 2013 9:05 am
Re: CircuitPython 0.8.1
Some progress:
With the following changes I was able to include framebuf and get the ssd1306 simpletest.py to execute.
I enabled framebuf and set Error Reporting to "TERSE"
With the following changes I was able to include framebuf and get the ssd1306 simpletest.py to execute.
I enabled framebuf and set Error Reporting to "TERSE"
Code: Select all
diff --git a/atmel-samd/mpconfigport.h b/atmel-samd/mpconfigport.h
index 667f9bf..6441e1e 100644
--- a/atmel-samd/mpconfigport.h
+++ b/atmel-samd/mpconfigport.h
@@ -31,8 +31,8 @@
#define MICROPY_HELPER_LEXER_UNIX (0)
#define MICROPY_ENABLE_SOURCE_LINE (1)
#define MICROPY_ENABLE_DOC_STRING (0)
-//#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
-#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
+#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_TERSE)
+//#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_NORMAL)
#define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (0)
#define MICROPY_PY_ASYNC_AWAIT (0)
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)
@@ -51,7 +51,7 @@
#define MICROPY_PY_ATTRTUPLE (1)
#define MICROPY_PY_COLLECTIONS (1)
#define MICROPY_PY_DESCRIPTORS (1)
-#define MICROPY_PY_FRAMEBUF (0)
+#define MICROPY_PY_FRAMEBUF (1)
#define MICROPY_PY_MATH (1)
#define MICROPY_PY_CMATH (0)
#define MICROPY_PY_IO (0)
vagrant@vagrant-ubuntu-trusty-64:~/source/circuitpython/atmel-samd$
- tannewt
- Posts: 3305
- Joined: Thu Oct 06, 2016 8:48 pm
Re: CircuitPython 0.8.1
Thanks for reporting back jerryn! Setting the error reporting to TERSE is a great way to give space to the framebuf module. I'll make a note of it on the release. I think we'll want to leave better error messages on by default though. Tony and I talked about adding a Python framebuf module in case its not built in.
Please be positive and constructive with your questions and comments.