#circuitpython-dev
1 messages Β· Page 127 of 1
it's an installer for python stuff
you may already have it if you've installed python, so just give it a try
the 3 just means python 3
I'm guessing that I don't cuz my PC didn't know what to do with the mu-editor-1.0.0b12.tar.gz file.
hmmm. but it got that somehow?
it got what?
what do you get from:
pip3 -V
I wasn't able to get the mu-editor to see the circuit playground express on windows 10, but that was a week or two ago.
pip being the installer that u mentioned, 3 from the ver of Python (mind u those I only know cuz u said them) & the other I don't have a clue
yeah, you need the 3 because there's also just pip which is typically the Python 2 version
Python 2 and Python 3 are different things (sadly)
so you need to make sure to run the Python 3 version of pip
this simple command:
pip3 -V
Python 3 is the default, in fact, Python 2 is not supported anymore.
Since some 2 years.
@stuck elbow python 2 support ends in 2020:
https://pythonclock.org/
Python 2.7 will retire in 2020. Learn more and see the countdown here.
Yeah, that's the security updates and stuff.
But no new development is happening since a while.
ok, how do I get python 3 & how do I get my PC to install mu-editor-1.0.0b12.tar.gz file.
@solar atlas do you know how to bring up a command window?
yup got it
ok, now try just typing that simple command: pip3 -V
not a reconised command
ok, so it's not installed
i'm seeing kattni suggested something over in #help-with-projects
it's a different approach, installing putty. have you tried that already?
@solar atlas how did you get the file mu-editor-1.0.0b12.tar.gz ?
Ya I was just looking at that but would like to get MU working if possible. It''l be much easier for my daughter to work with & learn with then that way
From a link in the link that u sent me.
I clicked download & it bounced me down to the bottom of hte page where that file was listed.
I have not started working on the APDS9960 driver for circuit python...
So if anybody feel like doing it, please do.
I'll report here if I find more time and energy for that project.
Regards
ok. see it. yah, that file is not going to be useful for you.
I wonder if it would make sense to have a constant in the busio module specifying the maximum clock speed on the specific board?
can I just search for python 3? Like I first did with the Mu.
think so. was checking that. looks like pip comes with python3 these days.
Cool, & it looks like python has uped again. it says to download 3.0.1 now.
if that's a python version, it's pretty old
try going here:
https://www.python.org/downloads/release/python-363/
download the Windows x86-64 executable installer
Ok, I was wondering about that cuz it said that that ver was relieced on '09
current relase is 3.6.3
ok, I found 3.6.3 on the downloads page.
ok. should be able to just download and run the executable installer
yup it's installing now.
ridiculously slowly...
Lol, there we go now the bar is moving.
ok. and just to be clear, what you're installing is not circuitpython. it's the full on big sister python.
you'll be able to go to the command prompt and do:
python3
to run it (if you want)
and for windows it might install some shortcuts and stuff also
but at this point all we care about is pip
ya I figfured that that is what it was, the full enchalada. And that's fine just so I'll be able to finally get that ver of Mu to work including the REPL.
well, hopefully. it is still beta.
@solar atlas mu is very beta still so we can't promise REPL will work now
@unique turret there's probably a more pythonic way, but this'll work:
def get_stuff(temperature):
n = 0
color = 0
if temperature > 70:
n = 1
color = cyan
if temperature > 80:
n = 2
color = blue
#
# etc
#
return (n, color)
But that was the whole reason for going through all of this. @slender iron . Do you know how to get Mu to change what board it looks for? I installed Mu, but it keeps looking for a micro bit & I am using a CPX.
i think only the beta has CPX at this point
ok, even still, what else do I have to do to get the Beta ver of Mu to work?
Nope dwnld is done.
ok, what was that comand again?
ok forget it, I found it.
k did that said that it's not defind
pip runs from the command line.
type quit() to exit the repl (you know this by the >>> ) then enter the pip command at the C:> prompt
Oops that's were I first tried entering that cmd, was in the python cmd promt, but I just put it in the reg cmd & it looks like it ran ok.
ok, now do:
pip3 install mu-editor
there's like a "run as admin" in the context menu
but in the UK
Google says
There is no sudo command in Windows. The nearest equivalent is "run as administrator." You can do this using the runas command with an administrator trust-level, or by right-clicking the program in the UI and choosing "run as administrator."Mar 11, 2012
How to run 'sudo' command in windows - Stack Overflow
https://stackoverflow.com/questions/9652720/how-to-run-sudo-command-in-windows
How would I run the following command in windows:
$ sudo django-admin.py startproject NEW
?
yep
lol, sry the Nube tossed in his 2 cents. π
@solar atlas i think that's the answer. do you know to do that?
O bollex. I forgot about running the cmd in Admin.
Hmm not sure how to do that in Win 10
if you can open the cmd window via that approach, then just run the command again
oh
unfortunately i'm not sure either...
how did you bring up the command window currently?
My circuit playground express is showing up as USB Drive in windows, is this a bug or is it windows?
right click select 'RUN'
I googled it but the instructions that google returned dnt make sense for Win 10
@opaque patrol its intentional. whats the name of the drive?
D drive
ah, not CIRCUITPY or CPLAYBOOT?
I think the mu-editor is looking for CIRCUITPY, but it can't find my Metro M0 or trinket m0 either
Is "Power shell the name for CMD promt?
I'm not a windows user so I can't help you
powershell is an enhanced version of CMD, sort of
maybe. that used to be a different shell with more commands.
you can run most CMD commands in powershell
@solar atlas One way to run the cmd on windows 10 is to right-click in the task bar and open task manager, then on the task manager click File > Run new task
@slender iron I was just asking because I think mu is looking for that drive name, but I am still looking at their code to make sure
yeah, I'm not sure about it either
@solar atlas can you get a "Run as administrator" to show up if you right click on the cmd prompt shortcut in the start menu?
ok, ya I was just googling it & it said that it is basically the same just not as good. as the classic CMD
@solar whale I fixed the bundle names: https://github.com/adafruit/CircuitPython_Community_Bundle/releases/tag/20171128-1
I found it.
Search CMD then instead of just hitting "Enter" hit"CTL +SHIFT + ENTER" It'll ask if that's what to do hit yes & ur running as admin.
neat
I'm down right surprised. Goes to show doesn't matter what you go through, even years of Mini strokes, you can retrain & relearn & regain what you thought you had long sense lost. π π
Ok, I think it finished.
SPI non-DMA added by #443.
looks better
Cool. what's next?
run it. did it add it to the start menu? or shortcut on desktop?
run it from the CMD with just mu
Nope nothing new on the desktop & nothing new in the start menu. Does that mean that it didn't work?
What CMD do I put in to run it?
same way you ran pip
just type "mu" in the admin cmd? ok
that, or hopefully don't need admin privs at this point
so maybe try it from a non admin command window
IT LIVES!!!!!
When I run mu, there are no "Ok" | "Cancel" buttons on the selection dialog, but I was able to modify the settings.json file manually to use Adafruit
Lol, ok, I select Adafruit python right?
But it still seems confused on whether there is a device connected
Windows 10
Yup it works now. well looks like its all good. I'm going to try it with a cpx now
No buttons
But if you go to C:\Users\David\AppData\Local\python\mu (replace David with your User name) you can edit the settings.json file
See mine had the button at the bottom.
@opaque patrol thanks. i'll pass that on to the mu author. did you do anything non-standard during the install?
@opaque patrol @timber lion saw a similar problem
@solar atlas sounds like you don't have the ui issue. so see if you can get the REPL to work.
No, but I might have installed PyQt before... Qt is notorious for conflicting with itself
@slender iron yeah, i'm on that thread. i'll add that screen shot to the discussion.
@opaque patrol that's very much likely what the issue is
Which thread? I am looking at the mu code now
@opaque patrol internal email π
@tidal kiln Okay, I uninstalled everything that looked Qt related in pip and I am reinstalling the mu-editor now.
cool. any info you can come up with for 'why it broke' or even 'what got it working again' would be useful.
I am curious if it is working for @solar atlas
Okay, I got the buttons, but still can't do anything in the repl
so it was just a qt thing?
Not really working well. I'm having a hard time getting Mu to up load & show anything in REPL.
I also tried pinning Mu to the task bar & that didn't work either even though it showed that it was until I closed Mu & there wasn't any button for it in my task bar.
I changed code.py to Blinky and saved and it works that way
@solar atlas You really should try using putty or tera term, you can still use mu for an editor
@slender iron do you know status of mu beta on win10? sounds like there's been discussion here about it.
not really
Hey, It works now.
@solar atlas Try closing mu-editor, then press the reset button ONE time to reset the cpx, then restart mu
I had an extra step of connecting to the com port with tera term but hopefully that won't be needed
Ya it looks like I'm going to have to use one of them @opaque patrol , I can't even get Mu to upload a program to the CPX let alone use the REPL.
"theme": "contrast",
"mode": "adafruit",
"paths": [
"D:/code.py"
],
"workspace": "D:\\",
"microbit_runtime_hex": null
}```
these are the settings mu is using, you could try ensuring the workspace dir is correct for you. If you click Load, does it open to the correct directory?
Wow, nice what all that @opaque patrol ?
Yup it looks like its going to the right place.
THe program that I have in there right now?
from adafruit_circuitplayground.express import cpx
cpx.pixels[0] = ((0, 0, 3))
cpx.pixels[5] = ((3, 0, 0))
It just has Blinky right now
@solar atlas what do you mean by not working?
I try & save or upload to the CPX & it doesn't work.
does it act like saves ok?
to the CPX? nope not at all.
do you get an error message of any kind?
nope.
so if you change the code, try to save the changes, it does nothing and the changes get lost?
program does show anything, any issue but yet the CPX doesn't change at all.
I even closed Mu reset the CPX & tried again to no evail.
@tulip sleet First test of SPI Flash on M4 Express working well!
Strange thing also, The only way that I can open Mu is by thru a CMD promt, but then after I open Mu, if I close the cmd window Mu closes too.
That is because mu is a child process of the cmd window
I'm able to upload to the CPX thru other programs like Atom, but just not Mu.
@solar atlas try changing your code.py to the following:
from adafruit_circuitplayground.express import cpx
cpx.pixels.fill((255,0,0))
That's weird! Ya that worked perfectly.
That other code worked before with no problem being sent from Atom, but then didn't from Mu.
@slender iron testing with the "py" bundle on M4 - looks good! Thanks!
Yup, again worked perfectly
Do you still have it open in Atom?
@solar whale great!
@solar atlas ok, now change it back to your original code and see what happens
Nope closed atom a long time ago.
back when we were getting Mu to work.
again worked perfectly.
cool. not sure what original problem was. something was just wrapped around the axel.
but now basic editting and saving works
Any idea why
from adafruit_circuitplayground.express import cpx
cpx.pixels[0] = ((0, 0, 3))
cpx.pixels[5] = ((3, 0, 0))
wont work anymore?
this is the path to mu.exe C:\Users\YOUR_USERNAME\AppData\Local\Programs\Python\Python36\Scripts
oh. thought you just said it did?
you can create a shortcut to it to run it directly
O, na I thought u ment change it back to the orriganal code that u sent
The all red one
this
from adafruit_circuitplayground.express import cpx
cpx.pixels.fill((0, 0, 3))
But yet This
from adafruit_circuitplayground.express import cpx
while True:
if cpx.switch:
print("Slide switch off!")
else:
print("Slide switch on!")
Didn't work. Or at least isn't showing anything in the REPL.
are you able to use the repl? It might need to reload (CTRL-D)
@solar atlas you have the repl window open? at the bottom of the editor?
If you click in the repl and hit CTRL-C, then any key, do you see a >>>
nope nothing happens
@tidal kiln all of the various programs that I've been trying on the CPX that I've been saying ya or na if they work.
The last one that I just showed. The one that is supposed to be printing to the REPL
It won't let me open the file more than once
K, closed all of them, closed Mu, & reset the CPX. Now restarting Mu.
O sure now it work. π
something about all those tabs being opened then
there are known issues with various OS's doing delayed writes
mu is trying to fix that
but not sure what it was doing with those multiple tabs
Wait a minute! I didn't have repl open when I took that pic & then when I opened the repl it didn't show anything.
I swear this thing is messing with me. EEERRGGGG>>>
lol
try this, change code.py back to this:
from adafruit_circuitplayground.express import cpx
cpx.pixels.fill((0,0,3))
save and verify that you get blue pixels
@solar atlas mu is really finicky....I was able to break the repl on mine again and had trouble getting it to work again
Finicky is an under statement. I'd say spoiled & possed.
Ya that code works fine @tidal kiln
ok. with that running, post a screen shot of mu
click down in the repl and see if you can do anything....try CTRL-C
If that doesn't work, click on the Adafruit by the gear in the lower right corner and select python
nope still nothing
and Click ok, the repl window will close and you will need to re open it, does it come up with Jupyter QtConsole? Takes a few seconds
ok report sent.
nope repl stayed open & nothing else came up. n sry first thought that what came up was a bug report and not just a log.
You have to click the label next to the gear,
This will open the dialog where you can select which mode (Python, Microbit or Adafruit)
Try changing it to Python to see if the Jupyter repl works and then change it back to Adafruit
ok ya the menu to select what ur connecting with right? ya that came up.
@meager fog tried new mu updates - from ntoll repo - (has your updates included) - My linux box now recognizes my Trinket M0! Nice! Just curious - I don't see any M4's in the new list - are they just waiting for official release? At least on my linux box, attempt to REPL to Metro M4_express fails. No hurry on this, just wanted to make sure i was expected.
@solar atlas right, try selecting the Python3 option at the bottom and clicking ok, then give a few seconds and open the repl
Okay, now try switching it back to adafruit and see if the repl reconnects
@meager fog I reread your updates and see you were refering only to CP 2.1 for mu so it makes sense m4's are not included. Sorry if I jumped the gun. Thanks for the updates.
I gotta run and pick up the wife, I should be back in 15 minutes, I think the com connection is getting stuck open and when you try to open the repl it can't reconnect. If it isn't working yet, try closing mu and resetting the cpx and maybe unplugging it and plugging back in before you restart mu again
ok,
@slender iron I'm satisfied now, understanding what's up with the SPI clock rates. Going back to busio and pulseio. Maybe uart next.
@tulip sleet awesome! good sleuthing
anybody on windows want to try https://github.com/Eugeny/terminus/releases as a terminal? I may try hacking it to support auto-connect to circuitpython
I'm kinda surprised the granularity of SPI clock rates is so jumpy, but I guess for many applications it doesn't matter.
@solar atlas The issue @opaque patrol suggested seems likely. I know even running the REPL from terminal (cmd) in MacOS I run into issues where it stays open and then can't reconnect. I have to reset the CPX to get it to play nice again.
I am able to break it though. If I reset the cpx while open in mu, it locks me out. I am looking for a way to fix it that doesn't require connecting with putty or tera term...
@opaque patrol FYI - I just tried resetting CPX while in Mu (on linux) and it recovered if I exited REPL and reentered on MU - that is click on REPL to exit - click again to reenter.
@solar whale Not sure if you want to try this, but what happens if you have mu-editor open with repl open and press the reset button on the cpx?
@slender iron Have a good evening!
ah - mu editor is dead π
nevermind - just a hidden window!!
@opaque patrol it seems OK - it was confusing because it opened a window to select a file for load but it was hidden behind active window and would not respond unitl I brought it forward.
also hlep to use the correct keyboard π
@opaque patrol I have to exit REPL and Reneter REPL but then it is OK - open file seems happy. If I try to re-open it - it tells me it is already open.
sry for disappearing. Mia needed me.
@solar atlas Excellent reason
It locks me out completely on windows, If I reset the cpx while mu repl is open....I couldn't do anything through tera term or putty, it took disconnecting the cpx and resetting it a couple times before I was able to get it to respond. I am not sure if that was the fix or maybe the original connection in mu timed out
If MU has REPL tehn on linux I cannot use screen to connect. Only one program can have the device at at time
right, but it appears that the connection is getting held open when the reset occurs
It also has the annoying habit of switching the comm port on linux between ttyACMO an ttyACM1
@solar atlas It's very new and still in beta. Sorry we couldn't get it sorted.
but taht is not mu - always happens when resetting M0 boards
@solar atlas You could try restarting the computer.... you may also want to try running the pip command again to install mu-editor only with the --upgrade option to ensure all the packages it is using are up to date.
That's ok, I have no doubt that you guys will get it all sorted out. π
I'm going to try the next code in ur guild & see how that one behaves in it.
@solar whale it I reset it with putty, It closes the connection and I have to restart putty, on tera term it picks it back up seamlessly. But mu seems to be locking it and it stays that way for a minute or so
@solar atlas Once you get Putty setup and the config saved, it's opening another program next to Atom, and running it. It's an extra step, but if you take a screenshot or write it down, Mia will get it memorised in a few tries I'm sure. I'm happy to help you though setting it up if you'd like to give it a try.
@opaque patrol I am very new to mu - so just poking at it. There was an update today that made it recognize some devices I could not use before. Not sure if updating would help. I am using 1.0.0beta.12
with this code:
from adafruit_circuitplayground.express import cpx
cpx.play_tone(440, 1)
isnt that supposed to just randomly play a tone without touching anything?
Yes, for 1 second, the first time the code runs.
Hmm, no luck.
Hmm. You had it going yesterday right? Is Mu still open?
works for me...
Because there is a state the REPL can be in that will not run code.
@solar whale same here, I haven't really used it before today. I wasn't able to get it to work
So if the REPL is stuck in that state, your code will not automatically run.
So if Mu is causing issues with the REPL, it could be interfering with code running as well.
@idle owl I can edit code.py and it picks up the save no problem. I just can't connect to repl
@opaque patrol And that's how it should work but I'm wondering if it's part of the issue @solar atlas is having.
@idle owl I think it is related.
I'm wondering if the REPL is connecting weird, or enteriing the >>> REPL state and not exiting it when you exit the REPL in Mu.
I just put that into code.py (in mu) then saved and did soft reboot in REPL and it played the tone
My thought is that the REPL failure in Mu is interfering with code running on Dao's CPX.
I'm guessing though.
it shouldn't interfere with the code running, but if there is an error then it is hard to tell without the repl, I know the led blinks can give error information, but that isn't easy
Right
also now presing RESET button play tone. @idle owl I agree - sounds like the REPL issues and save issues are related
That's what it should do on reset with that code, yeah
Oh! I built the new M4 build and forgot about it in looking into this, lol. Time to test!
@idle owl good luck - make sure you have a complet e copy of your FS first !
I open code witer & uploaded the codes, still didn't work until I closed Mu, the codes worked like a charm.
@idle owl no worries - latest bundle works fine! also I tried the "py" bundle - also works fine.
Just added the files back and my rainbow is off and running again. @solar whale Awesome good to know!
@solar atlas Yeah, I think the REPL issues in Mu are causing issues with running your code.
nice to have some room to play!
Makes sense @idle owl
How do I get one of the other programs that will let us see the repl?
@solar atlas Ok! Let's do it π
I'll grab the link again and then help you through it
I know u said I'd be better off using one of those like 8 hours ago, but what can I say, I'm stubburn.
No, Mu would have been much better! It made a lot of sense to try
He, He, he, he,
This will involve a little bit of a learning curve, and the more steps we add, the less appealing it becomes. Like I said, though, it's just a matter of it becoming a habit to add to your routine with CircuitPython
mu is still in beta,
Exactly!
Early testing always involves finding issues
@solar atlas You will not need the drivers first mentioned in that section as you are on Windows 10
O ya absolutely. you guys shld have heard of all of the bugs they had to work out to get Quixtar web sight up & running. Like I said, I have no doubt you guys got the skillz to get it runnin smooth as silk.
whr shld I start? Determine Your Serial Port?
We're all helping by finding issues but it's @plucky flint who has the skills. He designed and wrote it.
@solar atlas Yes
Dnt think I've talked with him yet.
@opaque patrol perhaps alpha+
@solar atlas Probably not, he's in a much different timezone than us and he's been busy with writing both a book and the new editor.
ok, found the port easy enough, it's not named anything specific, just com 8 but it's the only one there so.
@idle owl @solar atlas @opaque patrol I ddi not mean to be negative at all regarding mu - it is a great tool and has come a long way very quickly due to the efforts of @plucky flint -- the beta release is really nice.
This stuff that I'm doing, will all of this have to done everytime? or am I able to do some stuff once only?
Some of it once, some of it possibly each time
The everytime stuff, is it easy enough that Mia will be able to do too?
I would say so, she seems quite gifted. It'll just be a matter of following a couple of steps.
I didn't think u were bashing it @solar whale , you were just commenting. No worries. π
ok cool. Thanks @idle owl
You can save the configuration in Putty so she can click on it, but if the port changes, she'll need to know how to find it.
I just checked to make sure it's loadable in a way that can be changed before opening it, and it is.
I'll brb tho. I is a wantn me some lemonade. lol
ok cool, finding a port isn't too difficult.
If you can get it to work in Putty, then you can go and try mu again... that seems to make it work for me
Nice ok @opaque patrol
@solar atlas close putty first though
I had trouble getting putty to talk to my Metro M0 Express's REPL. I switched to Tera Term and it worked immediately.
It's even smart enough to find the COM port for you.
Or it's magic.
Or it's the wine.
@solar whale I figured the alpha comment was related to the fact that he might still add features. As that was drilled into me as the difference between alpha and beta is that beta has all the features, and is just testing π
@jovial steppe All good options.
@idle owl I have to admit, I have never tried editing a code.py in "real time" like this - I have been just playing with changing the tone - it is fun! I'm easy to entertain π
@solar whale That's great! Fun on all counts. And think about what I went through! I wrote the project! Just stopping in the middle of doing other things to play a bunch of notes for no reason because it was sitting there...
good night all!
@solar whale Have a good one!
@slender iron I tried terminus on Windows. No serial (COM) support that I could see! Maybe there's a plugin somewhere. Pretty heavy-weight.
@idle owl Please could you tell me how to run a .py repeatedly with no internal loop_forever and without doing a soft-reset, Ctrl-D ```>>> import piezo_music
#finished
That didn't seam to be too bad. π
@idle owl no,, just to rerun the same .py
I don't know then. I don't think I've ever tried.
@hollow tartan there's no easy way; you'd think you could re-import it, but import doesn't work that way
I try and it just returns the REPL prompt but does not DO anything. @brave cipher yes, I assumed it would allow a reimport. is the a GOTO top instruction?
in REPL
So it I import a different little .py with a different name , it will run it okay?
once something is imported, Python knows it and won't bother to re-import
well, sorta. I'm poking around in the micropython forum. You might try this:
def reload(mod):
import sys
z = __import__(mod)
del z
del sys.modules[mod]
return __import__(mod)
Don't know whether it works in circuitpython.
>>> import foo
hello world
>>> reload('foo')
hello world
@solar atlas Oi... It should. Maybe try restarting the connections again to start fresh after dealing with everything else before. You should be able to start Putty, and then edit away.
Do I edit in putty too? or is that just for the repl?
thanks @tulip sleet and @idle owl
@solar atlas Nope, Putty just runs the streaming serial REPL.
ok
You'll edit in a separate editor.
wasn't sure if that I was editing in another program was the problem.
Nope π
@hollow tartan reload works! At least for my simple example. If you create i/o objects and such, then you may get in trouble, since the pins will be assigned, etc. There a ctrl-D makes more sense
@solar atlas Hmm. I've never used Code Writer, but I don't think using Code Writer is the issue.
@solar atlas Also that code is missing the import, but that's not relevant yet if you can't even save it.
I'm trying to find Atom to try that instead.
@tulip sleet YES, I got it to work. Super!
Is there already a "code.py" on the board? Right click on it from the File Explorer and choose "Open with Atom" or whatever the specific wording is
@solar atlas looks like a corrupted filesystem. If you unplug it and plug it back in, then Windows (at least Windows 10) will complain and ask if you want to fix it. Say yes, and see if it recovers. It could be more damaged and you might need to wipe it.
Just so you know you're trying to edit the correct file.
@tulip sleet Hmm, hadn't considered that. It was saving ok until we got Putty connected to the serial connection.
I think anyway
I've already tried that
Try to edit with notepad and see if it also has trouble.
I can't figure it out, it was working fine before I installed putty. Cld Putty be bogarting the port, not letting anything else access it? Tho I don't even have Putty open right now & it's still doing it.
And you ejected and reset the board?
You can open code.py from the drive in the File Explorer? As in you can access the CIRCUITPY drive from Windows?
Putty doesn't do anything if it's not open. So that shouldn't be it.
wait do you have to eject the CPX before unplugging it? Cld that mess it up if u dnt?
Yes absolutely
It's a very simple system
Like an SD card plugged into your computer. If it gets unplugged, it can get borked.
what is borked?
You'll want to double-tap reset to get to the bootloader, and then copy the circuitpython-circuitplaygroundexpress-2.1.0 file to the CPLAYBOOT drive.
it's like a porked borg
Hah! No, sorry, it means broken, but what I really mean is that the system can get corrupted.
ok, so it is fixable then?
gotta run the flash eraser first
Oh yes completely
OH! Right, thank you Dan.
@solar atlas Hold on a second, it's easy. Let me find it.
You have that link memorized, probably
Ok, step 1: Double-tap reset to put it into the bootloader, you should see the CPLAYBOOT drive pop up in Windows and the lights on the board should be all green after flashing red.
@tulip sleet Is this the correct way to package this? ```# reload
(CircuitPython)
this REPL supplemental command was designed for use
with the Metro Express Explorers Guide on Learn.Adafruit.com
by Dan Halbert for Adafruit Industries.
def reload(mod):
import sys
z = import(mod)
del z
del sys.modules[mod]
return import(mod)```
Ok? I just pulled up the circuitpy drive & everything looks ok?
@hollow tartan well I didn't write it. I just stole it from the Micropython forum.
Hmm. It could also be ok even after getting removed.
It doesn't always get corrupted when removed without ejecting, just sometimes if it's in the middle of trying to write a file. Sometimes it can show up CIRCUITPY, and look fine, and still be unhappy though.
@solar atlas Try editing code.py again to check
Ya I'm thinking it's the later. I just tried opening the code.py file & it said corrupted.
The problem is that on Windows, and to a lesser extent on Linux, the file data can get written quickly, but writing the info about where the file is can be delayed for 10's of seconds. Doing an Eject forces that info out.
Ok yeah. So download the file I linked, double tap reset, and copy the file to the CPLAYBOOT drive.
@tulip sleet We had @solar atlas reset it so many times trying to get it to work earlier that I'm not surprised that it's unhappy now.
Lol, I upset it's lil rumbly tumbly...
@solar atlas Once you copy that file, it'll flash blue for a bit, and then it should flash green.
@solar atlas Exactly!
K. It's flashing green now
Nice!
Now double-tap reset again, and then copy circuitpython-circuitplaygroundexpress-2.1.0 (it's not exacly that, but you should know which one I'm talking aobut) to the CPLAYBOOT drive
'night all
@tulip sleet Goodnight!
Hmm, try the double-tap again, sometimes the rhythm is weird.
Takes me a few tries every so often. I'll get it on the first try a bunch and then it's 5 times to get it to work.
O wait didn't dan say that I had to run an erraser or something first?
Cuz Cplayboot shows fine but the reg drive still doesn't show.
The thing that should have made it flash blue and then green.
It did
Ok good, you did that correctly.
And you've double-tapped reset to get your CPLAYBOOT to show up?
And then you're trying to copy this file to the CPLAYBOOT: https://github.com/adafruit/circuitpython/releases/download/2.1.0/adafruit-circuitpython-circuitplayground_express-2.1.0.uf2
Ok no.
AH ok!
That's good, rather it be something simple. Download that file and copy it to CPLAYBOOT.
The one that I puyt on was the eraser. now I'll do the other
Excellent!
Gah! You created a new file and tried to save it?
Open it in Notepad and try to save it from there.
Actually hold on
@solar atlas Download this: https://learn.adafruit.com/pages/10330/elements/2917220/download Use the File Explorer to rename it to code.py and try to copy it to CIRCUITPY using the file explorer.
@tulip sleet Okay. thanks but I would like to put 'reload' in a .py file . I could not get it to be persistant - in residence. I even tried prefixing it into the music.py. He's gone. I will wait for tomorrow. unless, @idle owl?
@solar atlas That way we should be eliminating the potential for issues with an editor.
I have no idea what those issues might be, but I'm running out of ideas. The only thing I can think of is that everything is starting to conflict because we had so many things open and closed repeatedly. Have you rebooted the computer itself?
ok I did that. should it do anything?
@hollow tartan No idea, sorry
@solar atlas Touch the touchpads, does it make noise?
And light up?
it is alright, it can wait. g'nite
nope nothing
@hollow tartan g'night!
@solar atlas Ok, reboot the computer if you can. Let's try to start fresher than we are right now with everything we did.
reboot my pc, or u mean the cpx?
@solar atlas I've got a few minutes left but it's late here, so we'll try this and if it doesn't work, I can help again tomorrow, but I need to head out for the night. Reboot the PC
ok
@unique turret correction to previous code:
def set_thermometer_pixels(n, color):
NP.fill(0)
NP[0:n] = (color,)*n
NP.show()
ok I'm back up
Ok
What can I do to save this thing? This was Mias bday present.
I'm really sorry it's given you so much trouble.
after I erased it & put curcuit py back on it what did I dod wrong?
From what you're saying, you did everything right. It still won't let you save to it?
I don't care about that, I just want to fix it.
no not a code.py file, but those other two files saved to it fine?
the eraser & the new CP
Which two? Oh... it's different how those work, they're installers, not files. But if it let you do that, the board is ok, it's something else going on. Even just copying a file to it isn't working using file explorer? Hmm.
Open Notepad, create a new file. Put in it: ```python
from adafruit_circuitplayground.express import cpx
cpx.pixels[0] = ((0, 0, 3))```
Save it as main.txt
what about rying like an audio file or something?
And try to save that to the CIRCUITPY drive
I want to try to save any file to it at all, to see it works, but it needs to be suitably small.
I can't find the blessed notepad
Oh hmm I mean the one built into Windows... You should be able to type "notepad" into the little search bar at the bottom of the Windows menu...
ok, it saved & I was able to open it back up
yup
saved & opened from there
That's why the code isn't working.
Well, ok, that's one reason, this may not fix everything.
Huh?
I walked Mia through this. Create a new folder on the CIRCUITPY drive called "lib".
u lost me
Then somewhere on your computer right now is a downloaded folder called "lib", so probably in downloads. I had Mia download it when I walked her through it.
If you can't find it, I'll link it again
Inside that folder is a folder called "adafruit_circuitplayground", and you need to drag it from the downloaded folder (which has a ton of other folders in it), into the new "lib" folder that you created on the CIRCUITPY drive.
yes but its not on this computer
Ok got you, hold on
Step 1: download that file. Step 2. Create a folder on CIRCUITPY called "lib" (if you didn't already). Step 3: Unzip the file you downloaded, it's going to be a folder called "lib". Step 4: Open the downloaded lib folder, find "adafruit_circuitplayground" and copy that whole folder to the lib folder you created on CIRCUITPY.
ok irts workinig
Ok!
The PianoInTheKeyofLime.py file I had you rename to code.py and try to copy to the CIRCUITPY drive... Try that again
ok
Now touch A1, does it make a tone and light up? π€
Did it copy ok is a better first question
OH
no
Make sure the slide switch is to the right I think
otherwise it's muted
and doesn't run
it liuves
Yeah!!!!
lives
Thank u soooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo infitely much!!!!
Ok! I need to go to bed! We'll try to figure out the REPL again tomorrow!
You're so welcome, @solar atlas
You can also delete main.txt
@tulip sleet I realize it doesn't have the serial side of it. Cross platform is my main concern.
@slender iron so you want to add serial support, is that right?
@tulip sleet thinking about it. most of the good cross platform apps I know of are electron
Email from AdaBot! π
If you delete the adafruit_sdcard.SDCARD() object associated with the filesystem prior to calling storage.umount('\sd') the unmount is successful, allowing for a 'new' adafruit_sdcard.SDCARD()call and subsequentstorage.mount()` call to occur ...
@idle owl yup, the bundle autorelease worked last night π
@slender iron I see that! Great job!
Do you mean that you do del the_sdcard_object?
Code snippets for failure 1:
# Function that manages mounting and unmounting the SD card
def mount_sd_card():
global sd_card
global vfs
# Check to make sure an SD card is present
if sd_cd.value:
if sd_card:
del sd_card
sd_card = adafruit_sdcard.SDCard(spi, sd_cs)
vfs = storage.VfsFat(sd_card)
storage.mount(vfs, SD_MOUNT_PATH) # Mount SD card
print("SD Card Mounted")
return True
else:
...
@slender iron alright!
now if I could get it to open one tab per serial device...
i went down a similar path a bit already with my rewrite of mu as an electron app earlier and IMHO just going for a raw VT100 emulation javascript and electron serial access libraries is a good option: https://github.com/dtinth/vt
all the other web terminal apps i saw weren't interested in serial port access
and more focused on fancy console graphics
that vt library is really nice and easy to use, just chuck bytes at it and point it at an HTML object to render the terminal inside
also don't forget todd did a very similar thing as an electron app with the pi finder
electron app as SSH shell, but not hard to swap in node's serial access supporti bet
the trouble is as soon as you mix serial port access with node / JS life gets complicated.. most require native extensions which are a real pain on windows
people can't just NPM install without visual studio setup, they need a binary
something i wanted to look at was a little go-based thing that ran a local web server and websocket relay to serial ports, it could serve a nice HTML terminal and all be distributed as a single statically linked executable
electron is really tricky when you get native code involved i found
if you are going down that path though my suggestion is develop on windows, it is by far the biggest headache platform for node.. better to hit those issues early
@timber lion I'm taking a stab at hacking hyper to do it
they have their toolchain all set up
yeah i'd try on windows if you haven't yet, it's fun π although it does look like there is some progress in automating the node-gyp dependencies with https://github.com/felixrieseberg/windows-build-tools
otherwise this is the best resource i found, you need very specific versions of visual studio and python on windows for electron/node-gyp to compile native extensions like serial access: https://github.com/nodejs/node-gyp#on-windows
i had it setup in a vm because it was so fussy having multiple VS versions installed
you really need 2015 and not something later :/
why does it need to compile the extension again? doesn't it just download comething that is precompiled?
nope npm doesn't do binaries
node-gyp is supposed to make compiling native node code easier
but it still needs build tools
it looks like hyper can provide a setup exe
yeah to build that you'll need to get a windows environment setup with node gyp etc.
like i said there's a lot of unexpected complexity with windows, it's why i would develop first on it
I'm seeing if appveyor will do it for me π€
appveryor helps but it was python focused last i looked
i don't think it did node-gyp
that might be different though
ah nice perhaps they added an electron specific environment
yeah just wanted to warn be ready for windows fun, it's all toolchain pain and caught me by surprise
Toolchain Pain is the name of my next band.
haha, it didn't like the errors I introduced
will fix them after the gym
talk with you all later!
sheesh - this conversation is terrifying π
@split ocean Question: which version of the bundle are you using?
I'll check on that machine in a minute, but it was the 2.1 release IIRC
Thanks
@tulip sleet you around?
I'm in trouble ... just spent way too much at adafruit ... lol ... got a few Feather M0 Express' on the way... plus way too many other fun stuff ... hooked ... lol ... I think I got a few of the uni staff hooked too ... they really think the purple snake is so cute ... hehe good logo
anybody on windows with circuitpython want to try this? https://ci.appveyor.com/project/tannewt/hyper/build/artifacts
its super experimental
@worn birch That's great!
@slender iron what is it and what am trying?
its a terminal app that shoudl auto connect to a circuitpython connection
(really a serial port for any adafruit board.)
its a hacked version of https://github.com/zeit/hyper
so plug in a circuitpython board and then run the hacked hyper
I don't have time to try it on windows at the moment myself
it works on mac π
downloaded it ... but just realised I left the one board I currently (many coming in the mail) have at uni ... but I can try test it tmrw
@slender iron back in a few minutes
@slender iron Oh nice.
its super hacky but I just used it for something else π
Wait where's the dmg
Oh... my. Oi. π
@slender iron I have six separate windows boxes
I was looking at the links and missed you posting the file.
do you want to drop a test here?
the setup exe is available here: https://ci.appveyor.com/project/tannewt/hyper/build/artifacts
I think 56 MB is too large for me to attach directly
downloading...
π€
I have a window with 3 tabs. That doesn't seem to do anything. π
hrm bummer
I'm going to restart the app again
if you got multiple tabs it then found the boards
Good start then
Wait a sec, let me reset the boards. Might still have the serial connected.
you should be able to interact with the serial connect in each tab
is this derived from terminus or vice versa? Same weird startup animation
ah, that might happen if something else is already connected to the serial
its electron like terminus but is a different project
I swapped the pty stuff for a serialport connection π
It worked!
Shell
hrm ok
works!
it'd be cool if it was the board name
Agreed
excellent @tulip sleet !
does it just look for the first com port above 3 or something?
proof of concept β
@slender iron Well done!
nah, it actually looks at the usb vendor ID
if its adafruit's then it connects π
Really terribly working on IR, so 2 CPXs plugged in and the M4.
@slender iron so I gather it wouldn't work on a arduino uno then?
not in this hacked state
I tried swapping the background and foreground colors to make it light, and the title bar disappeared.
it'd be easy to fix
I thought it was running really slowly but no, that's my code being weird. Or both, but my code is definitely not right either. π
so whats the verdict? is it an interesting idea?
Definitely
the multi-platform thing is what' appealing: you said that. It's a big download. Does the mu repl window do the terminal emulation, like supporting readline cursor movement, etc.?
It's not any easier to keep track of multiple boards with "shell" for a title than it is with current methods (I usually have to ctrl+d a few times to see where the traceback is to figure it out if I don't have print statements), but I love the autoconnecting.
my take is go further for a full IDE like mu, I did that version of mu in electron a while back and it might be worth revisiting
I honestly don't know how mu does it
mu does VT100 emulation itself
it looks for the control chars and parses them
for my version i used one of those JS libs i mentioned
I think hyper is using xterm.js or something
they're really nice, just throw the bytes you get from the board at them and they do all the magic of moving cursor etc
if you could make it not exit when the board disconnects that would be great. That's the primary virtue of Tera Term: it restarts the connection nicely when it comes back (unlike Putty).
VT100 emulation is kinda non-trivial, i thought of doing it myself but the control chars are variable length
@timber lion thats my take on it too
thats why I was looking at existing terminals I could rip the core out of
ultimately you're going to want a nice UI to select serial ports, boards, etc. I think
and at that point, might as well add a simple text editor pane to save files .. like mu π
I'm trying to avoid that, other terminal programs give you lots of options
yeah i looked a lot but none do serial
alternatively... what about repurposing arduino
it's familiar and has all kinds of UI and logic for serial access
java, but they integrate the java runtime now
IMHO it might be easier to rip out the compile step from arduino vs. make a whole new thing
its not familiar to people who haven't used arduino
just need file saving
don't people know how to edit text files already?
it's no diff from mu, editor + serial port.. which is what we want cross plat ideally
I haven't used Arduino.
@timber lion meeting is starting
you also get serial plotter, library system etc
TOny, is there a decent example of writing variables to an SSD1306? The stuff I've read doesn't go into that
ah check out python string formatting and printing: https://pyformat.info/
foo = 28.2567
print('Value: {0:0.2f}'.format(foo))
for example to print a float with 2 digits after decimal
or you can save to a string
foo_string = 'Value: {0:0.2f}'.format(foo)
then send that string anywhere like SSD1306 text function
I'll tinker with it, thanks
Can someone point me to the directions @timber lion made to prevent a mac from adding extra files on a CircuitPython board
?
Should be able to, let me find it
I was looking at it yesterday, but can't remeber where it is
@unique turret https://learn.adafruit.com/adafruit-gemma-m0/about-circuitpython-libraries#non-express-boards-out-of-space
yeah this was the original page with the info too: https://learn.adafruit.com/micropython-for-samd21/usb-mass-storage?view=all#mac-osx-file-copy-issues
I will have to figure out how to arbitrate A/D conversions, those seem to be blocking and slowing down MIDI reponse
no paralllelizm in circuitpython
right, I will just have to have it do them under certain conditions
@ruby lake the AudioOut stuff can do it in the background
@slender iron I figured there was something π
well I have enough to do while the m4 is in the works
I used to do this stuff on a 4MHz Z-80. A 48Mhz M0 w/circuitpython is still faster
π
The uart is really fast even on single-character reads
π
is there a circuitpython dac library for things like MCP4822?
not that I know off the top of my head
I'll just wing it as usual
π we can help you write one
@slender iron Nice! Hah, M4 is unknown board. But two CircuitPlayground Express!
yeah, I decided not to leak the upcoming boards
Makes tons of sense.
π¦ M4 oooh ~
@tawny creek have you done electron?
@slender iron I have not but I know it touches a lot of web stuff π
yeah, its node, js and html
@slender iron familiar with the last 2 the most but i live with someone that works with node js more than i do
@slender iron what are you using it for?
trying to make a super simple serial app thats cross platform
open it and you get the serial connections immediately
I hacked up hyper to do it
I should probably rename it
Seems like a good idea.
that's a great idea!
@slender iron on osx rn, what do you need to get it going?
I posted a dmg above
downloads
@slender iron just a blank screen
@slender iron then updates to the screen with serial π
yeah, I think its a bit slow
plugged in a trinket m0 and its now outputting a buncha numbers (first time plugging the trinket hehe)
thats the demo, you should be able to ctrl-c it
sure!
you'll need to restart it after
a new windows build is here: https://ci.appveyor.com/project/tannewt/hyper/build/artifacts
yay! I love simple
@slender iron anything you want me to test?
thats pretty much it
this already feels like it will save me a lot of time @slender iron , been using just terminal and screen /dev/foreverchangingusbname -
@slender iron This thing will be amazing.
yeah, thats what I was thinking
what would be a good name for it? I don't want to release it as Hyper
Hmm
@tawny creek it would be epic if it could detect a new device and open a new tab
@slender iron hm http://www.writers-free-reference.com/172groupnames.htm
bonus points for a new logo too
SimpleSerial. Susie: Super Simple Serial.
Haha Susie is great!
@slender iron may tinker into electron stuff and see, not sure how it all works together but https://github.com/MadLittleMods/node-usb-detection
I'm using serialport to do a list at start up
it'd just be a matter of doing it periodically
@slender iron yeah that'd be nice
k, gotta head out. night all!
@slender iron Night! Have a good one
@slender iron update your hyper repo with your changes
@opaque patrol I think itβs up to date on the canary branch
@slender iron Ok, thanks...trying to build it on windows and Yarn is having issues
I built on Mac and used appveyor to build for windows
I updated my neopixel animation library and changed it to use the Circuit Playground Express neopixels by default https://github.com/waldo323/circuitpython_neopixel_utilities/ more documentation is still needed
So is this channel supposed to be for CP developers or CP users w/questions (or both)?
Both.
I've got a regular RGB led and I want to color blend, but when I try to pulseio.PWMOut on more than two channels, I get "Runtime error: all timers in use". Is the limit two PWM channels in use at the same time (!?!?).
As well as Python, and CircuitPython related hardware questions. And more. None of the channels are really limited. You just might get a better answer in one or another depending on the question.
I've only just started using PWM, so I don't have a clue, unfortunately.
I didn't want to ask user questions if this channel were primarily for devs, otherwise I could stalk the projecthelp channel
I don't see any mention of timer channel limits in the pulseio docpage.
Oh no, this is absolutely for users as well.
Excellent. Consider yourself annoyed by me then.
Done π
I don't understand pulseio well enough to help. The only thing I've done with it started yesterday and that's tearing apart someone else's IR code to try to figure out how it works.
Are you on ReadTheDocs? I'm sure anything I'm looking at you've already seen.
Yeah, I saw something in pulseio about generating carrier frequencies. That would certainly be useful for IR.
Yeah, i'm on RTD.
Ok, yeah. That's where I was looking as well.
Don't assume that I've seen everything. I'm making my first pass through RTD and porting an Arduino app which uses a lot of the "standard Arduino library".
Ok, I'll give it a scan too then. Sec.
Nah, I thought I'd ask first because I'm going to have to totally rework my app if I can only PWM two pins at a time. That seems seriously wrong, hence the question.
Yeah I don't see anything jumping out at me either. I wouldn't rework it yet. There's not always a pattern to when people are around, but tonight is quiet. The other option is the forums, which I know you know.
I'll check there now. Thanks. As you were.
@jovial steppe Anytime π (that I'm around anyway...)
Well, pretty much nil about "PWMOut", "pulseio" or "all timers in use" in the forums. I'll see if I can find the code for PWMout and see what the code/comments say.
@jovial steppe This channel seems to be users that become helpers and/or devs....
heya @slender iron , I finally got my pwm blinky working on my m4 board
@jovial steppe more than two should work if you leave variable_frequency as flase
@slender iron I did, I took the constructor defaults. I posted the details to the forum. The test case I supplied is the degenerate one.
Topic "after first two PWMOuts, "RuntimeError: All timers in use""
@jovial steppe I got back to you on the forums last night
@pastel panther great job on the M4!
@slender iron I finally got hyper to build and run in dev mode on Windows, I also found an issue with the productId using uppercase. Easy to fix, I will do a pull request if you want
@tidal kiln The function you wrote for my themometer works great. My code is almost complete. Last thing is to log the time and temp to a file.
@opaque patrol that would be great!
@slender iron I am still learning git as well. I did a clone of your repo. Do I need to fork it to do a pull request?
yup, fork and then add it as a remote to your local copy
I'm happy to help you learn git so feel free to ask questions
@unique turret awesome. did you see that second version i posted way later? i assume so as the first version should've thrown an error msg.
Yes, also I want to understand the code better, what does this line do (color,)*n that is the , and the *
creates a tuple of length n with all values being color
when you specify a range of neopixels, like with a slice, it expects a same sized range of colors
Cool!
that's what i messed up on the first version, i just had = color
also, you can use that * trick in other ways, ex:
>>> print("-"*70)
----------------------------------------------------------------------
>>>
Cool trick @tidal kiln!
So this is a general question. Before I can save to a file on the internal storage of my Feather M0 Express, I have to mount the drive. Do I create a boot.py file like this one by Dan Conley? ```import digitalio
import board
import storage
switch = digitalio.DigitalInOut(board.D0)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
If the D0 is connected to ground with a wire
CircuitPython can write to the drive
storage.remount("/", switch.value)```
Also I want to reverse the logic and use the button that is already on the thermometer
>>> bits = bytes([0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80])
>>> rbits = bits[::-1]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NotImplementedError: only slices with step=1 (aka None) are supported
How can I reverse an array in CP?
@opaque patrol try reversed()
@slender iron I tried that first, but it isn't defined. Should it be? Or do I need to import something?
I thought it was built in but sometimes we turn them off to save space
@unique turret thats a good trick to do if you want to write to the internal flash sometimes
boot.py will run once before usb is started
@opaque patrol
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> data = [1,2,3]
>>> data.reverse()
>>> data
[3, 2, 1]
>>>
@tidal kiln Thanks, (I was using it wrong) I was trying reverse(bits)
did you try it as reversed too?
Reversed is slightly different
looks like reversed returns an iterator
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> data = [1, 2, 3]
>>> reversed(data)
<list_reverseiterator object at 0x7f7831d727f0>
>>> list(reversed(data))
[3, 2, 1]
>>>```
ah
@slender iron Okay, for hyper...I forked the repo and redid the clone from there, did a remote add upstream to your repo and made the change. Now do I push the change to my repo and do a pull request?
gotta love slicing
oh, nerts
yet...
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit CircuitPlayground Express with samd21g18
>>> data = [1,2,3]
>>> data[::-1]
[3, 2, 1]
>>>
What, no, it works fine
Adafruit CircuitPython 2.1.0-14-g065a319 on 2017-11-14; Adafruit CircuitPlayground Express with samd21g18
>>> data = [1,2,3]
>>> data[1]
2
>>> data[1:]
[2, 3]
>>> data[::-1]
[3, 2, 1]
>>>
@opaque patrol what version cp are you running?
@tidal kiln 2.1.0
can you get the simple slice example above to work?
btw, fyi, the slice notation is list[start:stop:step], where the defaults for any omitted arguments are list[start (i.e. 0):end:1]
>>> data = [1,2,3,4,5]
>>> data[::2]
[1, 3, 5]
>>> data[1::2]
[2, 4]```
@glacial bronze try on a trinket
I don't have an M0 :/
@slender iron
Adafruit CircuitPython 2.1.0 on 2017-10-17; Adafruit Trinket M0 with samd21e18
>>> data = [1,2,3]
>>> data[::-1]
[3, 2, 1]
>>>
@opaque patrol either one.....but?? how'd you get that NotImplementedError ???
I think it has to do with the original array being bytes
ah
bits = bytes([0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80])
if I try to reverse this, I get an error,
yep. same here.
Oh, that makes sense
All these reverse things work on lists, but bits is no longer a list
I also notice there is an at symbol inserted before the x80 when i print it out...I suspect x20 and x40 are the at symbol
I see the same
@opaque patrol yep. confusing. i actually commented on that a few days ago.
so, how to easily reverse that....
oh, simple.... list(bits) turns it back into a list
>>> list(bits)
[1, 2, 4, 8, 16, 32, 64, 128]
>>> bytes(reversed(list(bits)))
b'\x80@ \x10\x08\x04\x02\x01'```
that worked, rbits = list(bits)[::-1]
bytes(reversed(bits)) works on CP-on-CPX
also @ becomes @
er
space then atmark becomes atmark then space
which makes sense
because 0x20 in space in ASCII
yep, x20 = space
and yep, x40 is @
what i posted previsouly....
interesting behavior when printing byte arrays:
>>> bytearray([0x01,0x02,0x03,0x1f,0xff])
bytearray(b'\x01\x02\x03\x1f\xff')
>>> bytearray([0x48,0x45,0x4c,0x4c,0x4f])
bytearray(b'HELLO')
makes it confusing when the values are mixed printable / non-printable:
>>> bytearray([0x28,0x02,0x5c,0x1f,0xff])
bytearray(b'(\x02\\\x1f\xff')
@slender iron do I do a pull request from your repo or mine or does it matter?
it should work as long as mine appears as the base
I don't think my boot.py file is working. Hmmm ```import digitalio
import board
import storage
switch = digitalio.DigitalInOut(board.D11)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
If the D0 is connected to ground with a wire
CircuitPython can write to the drive
storage.remount("/", not switch.value)```
why don't you think its working?
The drive mounts whether I pust the button or not
is it always writeable? it should mount read only when its writeable from python
Oh so it will still mount, but just not be writable?
It is working
My problem then is in my syntax for an error code in the guide
with open("/temperature.txt", "a") as fp:
while True:
fp.write('{}-{}-{} {:02}:{:02}:{:02}, {}\n'.format(current.tm_year, current.tm_mon, current.tm_mday, current.tm_hour, current.tm_min, current.tm_sec, tempf))
fp.flush()
led.value = not led.value
time.sleep(1)
except OSError as e:
delay = 0.5
if e.args[0] == 28:
delay = 0.25
while True:
led.value = not led.value
time.sleep(delay)```
indentation looks suspect, whats the error?
Traceback (most recent call last): File "main.py", line 79 SyntaxError: invalid syntax which is except OSError as e:
I will look at the guide to match the indents
yeah, I think the except should be indented the sames the try
Yes, that was it. Thanks @slender iron . For some reason now my lib folder is gone
hrm
I will put it back and see what happens
Instead of my feather being called CIRCUITPY it is now called NO NAME
uh oh, sounds like the file system is unhappy and needs an erase
it can happen if you reset the board without safely removing it or ejecting it from the main OS
I did a force eject
I just reloaded the .uf2 but I guess that the damage to the file system is beond that
Did I ruin my board? 
Nope!
Thank goodness π
The filesystem is corrupted, and you'll need to do a few steps here, but it's not ruined.
Which board?
it's very hard to break the adafruit boards
@unique turret Is there actually blue smoke coming from your board, because that might change the answer
No blue smoke, luckily π
@unique turret Which board are you using?
Feather M0 Express
We're going to use a flash eraser to clear the flash completely. Double-tap reset to enter the bootloader. Download this file: https://github.com/adafruit/Adafruit_SPIFlash/raw/master/examples/flash_erase_express/flash_erase_express.ino.feather_m0_express.uf2
And copy it to your FEATHERBOOT drive.
It'll flash blue for a bit, longer than the usual uf2 flashing takes, and eventually it should start pulsing green.
Yes, very short green pulses now
Excellent.
Now double-tap reset again to get back into the bootloader, and drag the CircuitPython Feather M0 Express uf2 to the FEATHERBOOT drive.
Hooray, I have the CIRCUITPY back
Now you need to put the libraries and the code files back onto the Feather and you'll be good to go.
Awesome! Thank you @idle owl
Instructions are here: https://circuitpython.readthedocs.io/en/latest/docs/troubleshooting.html#file-system-issues
And we're working on a Troubleshooting page to incorporate all of this into every M0 board guide, so it'll be easier to find
@unique turret You're welcome!
So to avoid this probelm, does anybody know why my computer says programs may be using the drive
I guess I will just shut down my machine to eject to be safe.
Oh.
@unique turret There are many reasons why it might say that. Serial connection, open to the drive in file explorer, the editor hasn't closed completely in the background... I either unplug it (which as long as it's done writing the file it's kind of ok, but you still risk corrupting the board), or I open Activity Monitor (Task Manager on Windows) and see what processes look like they might be hanging onto it, and kill those processes.
Shutting down the machine will certainly do the same, but it's worth trying these things first because it's much less effort.
On mac and linux you can also use lsof to see the processes that have a file open.
@idle owl I will try that next time
@stuck elbow There are lots of things that are open I guess after running lsof
You can filter by path, not at computer right now, can't check how
Hi all. My feather m0 express & joy wing arrived in the mail today. This will be my foray into CircuitPython. Does anyone have suggestions as to "start here" introductory guides & tutorials?
@wraith tiger Hi! Welcome! Congrats on getting started with CircuitPython! This is the main learn guide for Feather M0 Express: https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/overview
You can also find tons of other guides with tutorials and projects if you search the Learn System.
Thanks. Yes, I saw that one but I was thinking more in terms of gereral inroduction to CircuitPython itself.
Ah ok. Let me see.
There's a ton of CircuitPython guides in the learn system, but they're specific to different hardware. They would definitely give you some places to start though. As well theres the more detailed section of the Circuit Playground Express guide, which while specific to the CPX board, has a lot of examples that can help you get started. https://learn.adafruit.com/adafruit-circuit-playground-express/adafruit2-circuitpython
Specific hardware meaning different sensors and so on, not boards different from the Feather.
OK, thanks. I poke around in the guides a bit.
My code is finished!!!! This community made it possible β€
@unique turret Congrats! And thank you!
Time to solder this onto a permaproto board!
@wraith tiger the joy wing is a bit new and doesn't yet have a guide for CircuitPython, unfortunately
Old Crow's Module Playground π
Nice!
M0 FeatherX will be fun, but with M4 can do Z-plane filters and etc
what's that round thing in the corner? a din socket?
DIN5 for MIDI
I thought that all midi is usb-based these days
it depends, many live set players use classic midi
I guess that lowers the latency
new release files for libraries: https://github.com/adafruit/Adafruit_CircuitPython_DotStar/releases
Update CPX frozen libraries with latest changes, notably readinto instead of read_into, and shake detection added to LIS3DH library.
Considering releasing 2.x changes up to and including this as 2.1.1 (discussion with @kattni re this).
@slender iron got any thoughts on storing consts at module level vs. class:
https://github.com/adafruit/Adafruit_CircuitPython_OneWire/blob/master/onewire.py#L12
vs.
https://github.com/adafruit/Adafruit_CircuitPython_OneWire/blob/master/ds18x20.py#L6
I don't but @tulip sleet might
@tidal kiln are they meant to be available to outside users, or are they just used inside the class?