Тёмный
John Gallaugher
John Gallaugher
John Gallaugher
Подписаться
Videos from Prof. John Gallaugher, Information Systems Department, Boston College. Swift/iOS, Making, Robotics, CircuitPython, MakeCode, Raspberry Pi.
Web: gallaugher.com/ Twitter: @gallaugher Instagram: @john.gallaugher Biz/Tech Book: gallaugher.com/book iOS Book: gallaugher.com/swift

Information about Prof. Gallaugher can be found at:
gallaugher.com/about-prof-john-gallaugher/

Slices and NeoPixels in CircuitPython
13:58
15 часов назад
Комментарии
@christopherlyons7613
@christopherlyons7613 День назад
Having some trouble with the Connect app (both Mac & Android). For the Mac, when it starts it doesn't find my CPB. For the Android, it does find it and allows me to connect but the only modules displayed are Info & CircuitPython. I've tried with the other OS app not started but that doesn't seem to make any difference. I've also restarted the CPB. Any suggestions?
@profgallaugher
@profgallaugher День назад
I’ve found this a bit inconsistent, too, but it always seems to come up. Restarting the Mac or iPhone and the device often works. Some have suggested if the device comes up in Mac or iOS Bluetooth settings to highlight it and then go to the info icon and forget the device, then restarting and reconnecting. I’ve found the Mac app as the most reliable. Being able to work with the Bluefruit app is a big plus. You should find working with WiFi on the pico w much more reliable. The folks on the Adafruit discord should also hear about any issues you are facing as they are keen to address anything they can uncover. Cheers.
@tunmi88
@tunmi88 День назад
Thx for the video,im learning swiftUI right now
@profgallaugher
@profgallaugher День назад
Glad you enjoyed this. Keep hacking! More updates on SwiftUI coming soon. Am currently updating my CircuitPython course, but will absolutely be doing more with SwiftUI in the coming weeks.
@Sfdc123
@Sfdc123 День назад
dont use 3v3 for powering servos, use VBUS
@profgallaugher
@profgallaugher День назад
Drop some knowledge, Homie. What are your reasons why? What are the consequences? Share on!
@christopherlyons7613
@christopherlyons7613 2 дня назад
When using 'circup update -all' does it check to see what version of CircuitPython you're using and only update libraries to the latest version available for that CircuitPython version? Hopefully it doesn't update libraries to a newer CP version than you have loaded on your board. If it finds that you are using an earlier CP version, will it notify you that a newer version is available?
@profgallaugher
@profgallaugher 2 дня назад
Yes, CircUp won't add files that are beyond the CircuitPython version you're using. And if you look at the output, you should see if a newer version of CircuitPython is available, so you can go get that from CircuitPython.org and install it on your board, then return to CircUp and upgrade if you'd like. Small updates usually aren't critical, but I try to keep my boards fairly current.
@profgallaugher
@profgallaugher 3 дня назад
If anyone runs into problems installing CircUp, try opening the "Terminal" within PyCharm and doing the install from there. You may also need to install / upgrade pip3, as mentioned, but things should work. Also remember you can periodically run this command to upgrade circup: pip3 install --upgrade circup
@christopherlyons7613
@christopherlyons7613 3 дня назад
I'm seeing a bit different operation of the serial console. I've installed TIO but didn't have to go through the TERMINAL process you mention around 14:45. When I run my code in PyCharm it automatically shows a RUN option in the list on the left side of the screen (shown below the PYTHON CONSOLE icon) and that just gives me my console with output /input from the CPB. Not sure I understand whether this is using TIO in the background or is working directly by some other means. What's up with this? Interestingly I did follow along in the Adafruit guide for setting up advanced serial connection on the Mac and it mentioned using screen. And while playing with this I did set that up (which included using the serial USB connection obtained with ls). Screen seemed to work fine, showing the output from the CPB. I then went into PyCharm and starting following this video. Is what I'm seeing due to the fact that I had setup Screen to access the CPBs serial connection?
@profgallaugher
@profgallaugher 3 дня назад
You definitely do NOT want to use the run command in PyCharm. This is great for running code on your computer - which you would do if you were learning Python for data analysis or web development, but here we absolutely want to run the code on the CIRCUITPY board, so we ignore the "Run" command in PyCharm. In fact, once we start doing things outside of the simple print statement, that Run command will give you errors, since your computer doesn't have functions supported by CircuitPython, and it lacks hardware that's on your board. Screen can work as an alternative to Tio. Tio was recommended to me because if I unplug my board or press "reset", Tio will try to resume the connection, whereas I believe screen won't automatically re-connect.
@profgallaugher
@profgallaugher 3 дня назад
For some reason the question about installing CircUp got lost when I released it for publication, but I've posted this comment in the CircUp video for anyone experiencing problems: If anyone runs into problems installing CircUp, try opening the "Terminal" within PyCharm and doing the install from there. You may also need to install / upgrade pip3, as mentioned, but things should work. Also remember you can periodically run this command to upgrade circup: pip3 install --upgrade circup
@christopherlyons7613
@christopherlyons7613 3 дня назад
​@@profgallaugherFor me I'm not seeing the code automatically execute when I do a save (the blue unsaved changes icon goes away but not seeing the execution). I need to press the Green RUN button in the header which then shows me the console output in the run window at the bottom (this works for output & input). It's definitely running on the CPB not locally. Not exactly sure why I'm seeing this but all of this is working without any TIO actions completed in terminal. Still not sure if what I'm seeing for console I/O is going through TIO or due to my screen interactions. Would like to try to get this straightened out. Any hints?
@christopherlyons7613
@christopherlyons7613 3 дня назад
@@profgallaugher I tried installing Circup via the PyCharm terminal and that seems to have worked. I'm now seeing the installed version of 2.0.4 in both the PyCharm terminal and the Mac terminal. Aren't these the same? Isn't PyCharm just calling the standard Mac terminal? Why should there be a difference where the Circup install is executed from? At least it appears to be working now.
@profgallaugher
@profgallaugher 3 дня назад
This is something I've found out after the fact, but it seems that a PyCharm project might be keeping a separate walled-off area apart from the Terminal. I found that installing CircUp from the Terminal inside PyCharm got things working.
@chrismcg4533
@chrismcg4533 3 дня назад
Thanks for explaining the contents of the Definition - light bulb moment here. That helps so much. I've watched countless videos and picked up a lot, but this pulls it all together for me.
@profgallaugher
@profgallaugher 3 дня назад
Glad it was helpful!
@christopherlyons7613
@christopherlyons7613 3 дня назад
Have a new MacBook and trying to move the new CircuitPython .UF2 (9.1.1) to CPLAYBOOT. I'm new with Mac (Windows guy) and seem to be having a few problems. First, when I drag the new .UF2 it seems to dismount CPLAYBOOT before completing the copy & install (I get a notification saying that CPLAYBOOT has disappeared). If I bring CPLAYBOOT back up, it still has the older CP installed. Not sure why it's doing this. Earlier it did seem to get further with the .UF2 copy but it gave me a notification that I wasn't authorized to complete the copy/install (it was just a message, it didn't ask for a login or anything, it just didn't complete the .UF2 copy/install). Any idea why that would happen and what I need to do to ensure I have full access to do installs? I haven't had any other issues installing software. Appreciate any guidance. Thanks.
@joeblow229
@joeblow229 4 дня назад
These videos are fun, and interesting, but I don't tend to watch them because I feel like rather than a tutorial or lesson, it's like a spoiler for how to solve a puzzle, or cheating in school. Not sure why I think that way, just pointing it out, because I feel like this channel should have more subs and comments, and maybe other people are thinking the same thing? Edit: I'm going to start at the beginning, look at your course, and try to find a way to learn the lessons, solve the puzzles myself, then go back and watch the videos.
@profgallaugher
@profgallaugher 4 дня назад
Glad you think the lessons are fun but I’m not sure I understand the comment. There are lessons but also challenges. You can try the challenges - and should - before watching the solution. The solutions often show a new technique or tip, as well, so even if someone got an answer hopefully there is a tip in there. As a heads up, my students watch these outside of class, then in class I give them more challenges to complete. You are welcome to check out the weekly notes and challenges in the open Google Drive on my website gallaugher.com. The course canvas is closed but the drive is open. This technique is known as “flipped classroom” teaching.
@joeblow229
@joeblow229 3 дня назад
Thanks for letting me know, looking forward to getting started with these this weekend :) I've been making things with Arduino and Micro Python for years, but my programming skills are lacking and getting worse from lack of practice and relying on GPT to write and fix code for me.
@profgallaugher
@profgallaugher 3 дня назад
You'll find Python MUCH better to work with than C/Arduino. And it's a language that's used in many more modern contexts. C is dying, so I don't bother teaching this to my students. There are only a few performance reasons you'd choose Arduino over Python, and those are getting fewer as processors get faster. I used to take my students to Spice robot restaurant (bought by Sweetgreen), and all of their robotics were run using python. You should also find CircuitPython is more intuitive than Micro Python. And most importantly I find the support from the Adafruit Discord forum is just fantastic.
@annacallies1594
@annacallies1594 7 дней назад
love the voices hahaha! your teaching style is phenomenal and easy to follow. Thank you for making these videos short and easy to code along to. I also like that you include graphical representations of what is happening in theory/on the web and on your device. Will be watching more of your videos.
@profgallaugher
@profgallaugher 6 дней назад
Thanks for taking the time to write. More updates for the course are coming, soon. I'm currently updating my CircuitPython course, but I'm also teaching SwiftUI this Fall. I wanted to wait a bit for the WWDC24 betas to shake out before diving in. Very kind of you to share a positive word. Good luck with your learning journey!
@James-pj6cg
@James-pj6cg 7 дней назад
Do you have the source code on GitHub? I have watched this series 2 times and still can't get the reviews section to work. They save but don't display in the app
@James-pj6cg
@James-pj6cg 6 дней назад
Found where you posted the link in another video. Thank you for the series
@christopherlyons7613
@christopherlyons7613 8 дней назад
Do you know any way to allow CircuitPython programming on an iPad? Adafruit does have a doc talking about iPad use but that only deals with sending code to a connected device (CPE I believe in the doc). It doesn't address actually programming it nor getting access to the REPL. Are you aware of any IDEs that run on the iPad that would allow direct programming with REPL I/O (most interested in CPB use to start)?
@profgallaugher
@profgallaugher 7 дней назад
It's possible to upload any file from an iPad to a CIRCUITPY board, but the problem as you say is getting a full IDE that can do things like code completion & error correction. There are web-based IDEs. You might try: urfdvw.github.io/circuitpython-online-ide-2/ which is a project by River Wang. There's also a beta of an Adafruit WebIDE but I haven't done anything with it: learn.adafruit.com/webide/overview I doubt anything will be as robust as you'd get with a computer-based IDE. Good luck!
@elliadams
@elliadams 9 дней назад
I was so excited for the new video lessons that I wanted to re-do all of the projects on your previous videos from last year before I began the new ones. Unfortunately, I ran into a problem with Mu. Ive never had it crash on me before, but it kept crashing so I uninstalled it, restarted my computer and reinstalled it. It opened and worked for maybe 5min before crashing again. Its been a few days now and it just tries to load for a minute or two before crashing every time I try to open the application. Has anyone else mentioned this? Is there an alternative than anyone might recommend? I have Thonny for another class, but I liked Mu more. Im still very new to this so thanks in advance to you and anyone in your audience who might be able to help.
@profgallaugher
@profgallaugher 9 дней назад
Hi! In the new series I use PyCharm. You can find install videos for this and circus, which u also use, at the top of bit.ly/circuitpython-tutorials. I’m about 30 lessons into the update but have started with the CircuitPlaygrounds and haven’t gotten to the Pico yet. But you should be able to use the install videos to get set up. Check them out. PyCharm requires a bit more install work but is much better at error flagging and code completion. And circup automates adding and updating libraries. These are going to make things so much easier for my students. Good luck!
@toolzshed
@toolzshed 9 дней назад
Hhahahhaha that's so cool! A fruit drum kit!
@harpchallenged
@harpchallenged 10 дней назад
Followed your instruction for the Mac and got "command not found" on first try. After much fooling around, I looked at the Adafruit instruction and executed "pip install --upgrade circup", now it works.
@profgallaugher
@profgallaugher 10 дней назад
Did you follow the “pip3 install circup” around 10:53? Would be really weird that the command wasn’t recognized if the first install happened. Thanks for sharing your fix!
@thecomputercat8095
@thecomputercat8095 11 дней назад
You are an amazing teacher/instructor. Thank you for all you do!
@profgallaugher
@profgallaugher 11 дней назад
Wow, thank you!
@davidpulcifer3792
@davidpulcifer3792 11 дней назад
Is having the pressed and released in separate if statements instead of an if/elif structure going to create any unexpected behavior that you know of? In my testing they operated the same, but I was curious if there were any edge cases I'm not thinking of. if buttonA.pressed: pixels.fill(TEAL) press_count_A += 1 print(f"Press count A: {press_count_A}") if buttonA.released: pixels.fill(BLACK)
@profgallaugher
@profgallaugher 11 дней назад
Good question. There is no special reason I didn’t put them in an if elif instead of two if’s. The difference is if it were in an elif then if the first if were true the second would not be evaluated two ifs will evaluate the second if even if the first is true. I don’t have equipment with me as I write this but the only case to consider is if you’d want to deal with simultaneous push but if so if put that in an if/and and treat it as a single condition. Cheers
@Straja93Y
@Straja93Y 11 дней назад
Hej John , can we do the same with didSelectRowAt func ? i have built everything programmatically , but i have an error when i click on a row // Swift runtime failure: force unwrapped a nil value
@profgallaugher
@profgallaugher 11 дней назад
Could be. Not at my machine to try it, but also, I’ve been teaching SwiftUi for the past two years so there is a chance this older content has a need to be updated. I’ll likely be sticking with SwiftUI, though. You’ll see me refreshing this playlist later this summer as I prep for my Fall class. Cheers bit.ly/prof-g-swiftui
@btm350z
@btm350z 12 дней назад
I'm on a MacBook with Apple silicon and I am stuck on the print statement. When I enter tio dev/tty.usbmodem2101 in the PyCharm terminal, it returns zsh: command not found: tio. I went back to the prior video, reinstalled TIO and everything during the install worked as expected. This did not correct the error. Any help would be appreciated. I am a 64 year old newbie to programming so thank you for these videos.
@profgallaugher
@profgallaugher 12 дней назад
That command suggests Tio was not installed. Try tio -version. Make sure it’s lower case. If you don’t get anything to is not installed. Does the ls command give you that usb number? You want to use the number you get, not mine. Also try restarting your Mac and unplugging and plugging your device back in. If all fails, there is awesome help on Adafruit Discord. adafru.it/discord. Be sure to post your solution. You’ll get it!
@btm350z
@btm350z 12 дней назад
@@profgallaugher Thank you very much! I uninstalled everything and started over using this video ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-i7jEa2LyJtk.html I was able to use that video of yours, combined with this one, and the problem has been solved. Thank you very much for your fast response and for making these great videos!
@davidpulcifer3792
@davidpulcifer3792 12 дней назад
Is there anywhere I can get assistance with getting circup to work? I am using Windows 10 and have Python 3.12 installed on my machine. I installed the circup library and added the appropriate destination to my PATH variable, but I'm getting 'circup' is not recognized as an internal or external command. I've tried googling the issue but the only thing I can find on Circup is the stock standard install instructions.
@davidpulcifer3792
@davidpulcifer3792 12 дней назад
I uninstalled circup and reinstalled it and that fixed the issue
@profgallaugher
@profgallaugher 12 дней назад
So I assume you have sound this and if doesn’t help learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/overview Ask on Adafruit Discord. There are great folks there who will help quickly. And when you have an answer do share what helped. Good luck! adafru.it/discord
@davidpulcifer3792
@davidpulcifer3792 12 дней назад
@@profgallaugher Thanks! In case it helps others debug I uninstalled circup and reinstalled it, and that fixed the issue.
@TheUnofficialMaker
@TheUnofficialMaker 14 дней назад
just what i needed for my gate, thanks
@profgallaugher
@profgallaugher 12 дней назад
Glad I could help!
@scottbrown4534
@scottbrown4534 14 дней назад
I am curious about just how the flashy lights interleave with the sound playing. The application I've put together is a bit different to your example in that I am streaming stereo 44.1k via I2S serial to an external DAC to implement a doorbell with swirly multicolor lights using an rpi pico. My feeble little septuagenarian brain thinks there must be enough time between transmitting each I2S packet for the lighting code to run, but I can't quite work out why these two processes share clock cycles transparently... Or so it seems. Any insight you might share would be much appreciated. I'm finding Python to be syntactically simple in the same way that hyperbolic orbital geometry is simple. Most of the code I've written over the last 40 years was in Lisp, BTW, quite a paradigm shift... Question aside, I really enjoy your teaching style!!!
@profgallaugher
@profgallaugher 14 дней назад
I’m not sure exactly how the processor slices the code but there doesn’t seem to be any delay in executing functions while AudioOut.playing. Calling a function in that loop will execute a function but that called function runs to completion if the audio stops before the function is done. But some sort of processing handoff happens because there is otherwise no delay between the “concurrent” execution of continuous sound play and the called function. For more detail the library code is open source and on GitHub and there are also maintainers on the Adafruit Discord who can likely fill you in on details if you’d like. So glad you are enjoying the course. Cheers.
@scottbrown4534
@scottbrown4534 14 дней назад
@@profgallaugher Thank you, I thought there was something bustling behind the curtain; Time to dive into the source code. Now for extra credit: Do you know how Limor got her nickname?
@profgallaugher
@profgallaugher 12 дней назад
Ada Lovelace is considered "The First Programmer" - you can find out more information here: findingada.com/about/who-was-ada/. We celebrate Ada Lovelace Day as the second day in Oct. each year. I usually have my students do something fun, like this example from my SwiftUI class: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IjOvFaJyfL4.html Here is a VERY old video I shared with students years ago that mentions this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-IjOvFaJyfL4.html I'm pretty hardcore about promoting diversity in computing. You can find out some ideas here: profgallaugher.substack.com/p/things-all-can-do-to-encourage-diverse
@scottbrown4534
@scottbrown4534 12 дней назад
@@profgallaugher I knew you be would right on the money, but I hadn't planned on you being of the same mind as me regarding diversity. The women I worked with in my professional career were always there to save me from myself, but it always bothered me they were in what were called "menial" jobs with much lower pay. I realized a few years ago that I have been a feminist for most of my life. World War 2 was essentially won by the women computers at Bletchley Park, the work of Alan Turing notwithstanding. The list goes on and on... Most of the girls ran rings around me in the Lisp forums on CompuServe. Cheers! (Thanks for the links!!!)
@todbot
@todbot 16 дней назад
Neat! Thanks Prof Gallaugher for the shout out!
@Bestcellmike1
@Bestcellmike1 16 дней назад
Great videos! I'm excited to watch more and create new projects! I have an Adafruit Circuit Playground Bluefruit board with an older version of the bootloader (version 0.2.11). I'm having trouble updating to the most recent version of CircuitPython by dragging and dropping the files. Could you please provide some guidance on how to overcome this issue? This statement shows up on the learn page at adafruit- “Your board's bootloader must be 0.6.1 or later to be able to load CircuitPython 8.2.0 or later.”Thank you in advance for any help you can provide.
@profgallaugher
@profgallaugher 16 дней назад
Hi! Here is a document I prepared for my students a couple years back: docs.google.com/document/d/1J-Hmor7f2kaMpyntmG2dNOPeW21igF9wMnYT7VztReQ/edit and here is a more detailed doc from Adafruit learn.adafruit.com/adafruit-circuit-playground-bluefruit/update-bootloader. If you still run into probs, definitely check out their Discord channel. There are very friendly and helpful folks there. Cheers & good luck!
@Bestcellmike1
@Bestcellmike1 16 дней назад
@@profgallaugher That did it! Thank you so much! How do I take your online classes?
@profgallaugher
@profgallaugher 16 дней назад
Just follow along the videos in order at bit.ly/circuitpython-tutorials. I'm 28 lessons into updating the entire course for Fall. The last time I taught was Spring 23 (I've been on sabbatical this past year). The weekly lessons, challenges, and solutions are at Gallagher.com in the online folder for the course. The other material is behind the firewall because it's university canvas, but the weekly slides & solutions, plus the videos, are really nearly everything we cover, save being together in-person. You should be able to learn everything my students do through all of that. Cheers & tell others!
@elliadams
@elliadams 4 дня назад
@@Bestcellmike1 Im so glad you figured this problem out. Im still struggling with it though. Ive tried the Adafruit guide for both the arduino and terminal solutions and then @profgallaugher 's google doc, but Im too inexperienced to be able to figure out what Im doing wrong. My CPB has 0.2.11 as well and Im using Windows 10. I cant make heads or tails of the command line/ terminal instructions. The Adafruit forums basically just validate my feelings, as other much more knowledgeable people have expressed similar frustrations. I havent found much in the way of a solution though, most posts just link back to the learn guide. I literally just downloaded Discord for this exact reason, but all the posts seem to link back to the Adafruit guide. What am I missing? I feel like it must be something obvious but Im too frustrated to see it. Id be very grateful for any pointers.
@AM-jw1lo
@AM-jw1lo 18 дней назад
thought you were staying away from Mu. Matplotlib and TKinter and build a gui. More exciting to have something that works like a labview IMO.
@profgallaugher
@profgallaugher 18 дней назад
Yes, Mu seems the easiest to see plotting but there are some more options I’m investigating. TodBot suggested a neat tool but it requires some extra installation and I want to avoid that. If you care to check it out, link is below. I really like PyCharm as a Mu alternative. They are so many common errors students make that Mu will catch or warn about. github.com/hacknus/serial-monitor-rust
@AM-jw1lo
@AM-jw1lo 10 дней назад
Very nice link. Yah i fall back to Mu when things go screw, for a sanity check.
@billtudor1953
@billtudor1953 19 дней назад
I've been developing professionally for 10+ years (Java & Cpp), and I'm a huge JetBrains fanboy. I'm working on a quick proof of concept in circuit python and I didn't want to mess around with MU. This is great. I really appreciate your attention to detail. It's going to help a lot of people dive into development.
@profgallaugher
@profgallaugher 19 дней назад
Thanks so much! Glad you enjoyed it. Yes, PyCharm makes a BIG difference in catching simple errors that can trip up anyone but especially newbies, and the code completion is far better. Cheers!
@bertmonkey8457
@bertmonkey8457 21 день назад
As a total newby... am getting No Module Named board or digitalio... any suggestions?
@profgallaugher
@profgallaugher 21 день назад
Are you using CircuitPython and not microphone? Those modules are built into CircuitPython. They don’t need to be added to “lib”. So if you installed CircuitPython (earlier lesson) you should be fine. Just use the import statement in your code.
@profgallaugher
@profgallaugher 19 дней назад
Also make sure you've installed the proper CircuitPython library for your board. For example: Raspberry Pi Pico W if you're using the "W" board, Raspberry Pi Pico for that board. Has that solved you issue? Good luck!
@WShawn
@WShawn 21 день назад
I understand using all caps for variable names that are constant like BLUE or ORANGE. Why isn't time_interval also named in all caps? We're plugging an unchanging value into it, so it seems like a constant to me, too.
@profgallaugher
@profgallaugher 21 день назад
Hi! Yes, you can absolutely choose to change this to all caps if you’d like. The reason you might see this in lowercase snake case is that it “could be” that a program would modify the time interval. So where as BLUE would never change, nor would ONE_SECOND, you might write a program that takes a time_interval and changes it by, say 0.1 seconds up or down if you press A or B. It ultimately is up to you, though. One thing about Python is that there aren’t really constants so all caps is just a stylistic choice. You *can* write code to change BLUE to a non-blue value. As an aside: a language like Swift (that’s the other course I teach) you can actually define a value as an unchanging constant. Swift is a “type safe” language, designed to prevent lots of runtime errors & that kind of enforcement is one way to do that. Hope that helps!
@WShawn
@WShawn 20 дней назад
@@profgallaugher Great, thanks for the clarification!
@WShawn
@WShawn 21 день назад
Thanks for these tutorials. I would note that on the Circuit Playground Express you do NOT have to import all of these additional libraries for this touch pixel fill rainbow example to run. I wasn't able to track down a Bluefruit in a reasonable time frame so have gone with an Express. I was surprised that it worked just fine upon copying over and renaming the example code. From the docs: "For Circuit Playground Express, simply install CircuitPython to use this library - the library itself and all of its dependencies are built into CircuitPython for Circuit Playground Express." That said I've gone ahead and installed circup for future projects.
@profgallaugher
@profgallaugher 21 день назад
Thx for this! I’ve noticed that CircUp is aggressive in its imports and will often bring in libraries that might not be needed by code.py, but that *could* be used if a library calls another library. So I think it makes pretty broad decisions about imports. The learn guides on Adafruit for given techniques and products often list libraries that need to be used and those are usually a narrower set. If you were creating a project that was really tight on space it might make sense to pull out any libraries guide sure the project code doesn’t need. Do watch the output when running code. Sometimes you have to scroll up to see errors once code runs if your terminal window is not dragged taller. But if you get an error like “undefined <library name>” that likely means a key library is missing and needs to go into the “lib” folder. Also one thing about both CircyitPlaygrounds. They haven an additional optional library set “adafruit_circuitplayground” and there are some things you can do with this library that require less code, but those libraries are specific to those boards and code written calling these libraries wouldn’t work on other boards. So I’ve chosen to avoid them in the course because I want my students to be able to use techniques across all boards. For example, take code written for CiecuitPlaygrounds and run it on a Raspberry Pi Pico W. Most of the time you can do this for course techniques, with just a small tweak (like changing one line where lights are connected on a board). I’ll demo this later lessons when we cover the Pico. One notable exception is sound play. There are three extra lines you need to turn on the internal speaker of CircuitPlayground boards and those three lines don’t work on other boards. You’ll see me cover that in a later lesson, too.
@WShawn
@WShawn 20 дней назад
@@profgallaugher Thanks for the reply; I appreciate it! I'm 63 and build props as a hobby, and I'm hoping to learn enough coding to do these things myself rather than rely on a friend or whatever.
@WShawn
@WShawn 22 дня назад
On the Circuit Playground Express board I just got it takes a single push on the Reset button to put it into CPLAYBOOT mode. Powered up the board would play the included animation but would not mount on my Mac desktop as a CIRCUITPY volume. Copying the .uf2 file to CPLAYBOOT dismounted the volume which then came back as CIRCUITPY. Looking forward to further tutorials!
@profgallaugher
@profgallaugher 22 дня назад
Glad you got things setup properly. Good luck hacking!
@ASuperDood
@ASuperDood 23 дня назад
Hello from Xcode 16 and iOS 18! As Prof. Gallaugher alluded to, future enhancements from Apple might simplify your .onChange modifier: .onChange(of: selectedPhoto) { Task { if let newImage = try? await selectedPhoto?.loadTransferable(type: Image.self) { bipImage = newImage } else { print("Failed to set new image") } } }
@profgallaugher
@profgallaugher 23 дня назад
You’re great! Thanks for this. I’ve been refreshing my CircuitPython course first, but will start the iOS course refresh around Aug. 1. I appreciate the update and I’m sure students will, too. Cheers!
@ace.johnny
@ace.johnny 23 дня назад
The try/except imports might be less bewildering to beginners if you briefly explained the hardware differences between AudioOut and PWMAudioOut, and why PWM is required for boards without built-in DACs and speakers.
@profgallaugher
@profgallaugher 23 дня назад
Thanks. My philosophy is to hold new topic introduction until it absolutely needs to be introduced. A course that assumes no prior programming & engineering is a pretty big lift, even for my bright students, so if we don't need to discuss DAC concepts (and why some boards have them & some don't), I've chosen to leave that out. You'll see this approach throughout the course. We don't do a "blink" because it's actually more complex than lighting up an entire set of on-board neopixels, plus it's not really something someone uses in a real project. And we put off discussions of resistors (which is often a first-step in many electronics courses) because we deliberately choose Qwiic/STEMMA-QT that hides lots of complexity & lets students build stuff quickly without having to worry about deeper details. We're covering things like scheduling & IoT in the "Prescription Box" when we finally need a single LED and students have been pretty ramped up with concepts so as not to be intimidated. What I'd actually like to see is a unified sound library from Adafruit that will hide this setup from the user. Audio is likely the least "cross platform" thing we do in CircuitPython, but it's definitely possible to produce libraries that make the right configuration decisions for simple audio output. The CircuitPython team is fantastic & they have a lot on their plate. Unsure if this is something they've got scheduled, but your idea prompts me to reach out & post a suggestion on a git page. Cheers.
@ace.johnny
@ace.johnny 23 дня назад
I understand your approach, and I'm a big fan of your concise style, but in this video you spent a lot of time describing what you were doing, but not as much as usual on why. Just an extra sentence or two of hardware detail would have, in my opinion, justified the multi-library necessity. Something like, "The CircuitPlayground Express has a built-in audio circuit and can use the AudioOut library directly, whereas the CPBluefruit and Pico require a different technique called PWM which we'll dive into later." As a professor of complicated subjects myself (live audio engineering and design), I thought I'd share some constructive feedback.
@profgallaugher
@profgallaugher 22 дня назад
I might be able to add this when introducing these concepts in the Raspberry Pi Pico portion of the course. Thanks & best wishes.
@a9to495
@a9to495 23 дня назад
Thank you. Very helpful!
@profgallaugher
@profgallaugher 23 дня назад
You're welcome!
@christopherlyons7613
@christopherlyons7613 24 дня назад
Couple questions. First, is there any way to explore what's available in the community library bundle? How can you know easily find what's there without having to read through all the included libraries? Does anyone maintain a cheat sheet? Are there any community libraries that you find extremely helpful? Can CircUp work with the community bundle or just the standard Adafruit library bundle? I've always been a Windows user and have never liked Macs (long history, just my feelings). But for controller programming it certainly seems like there are some benefits. What Mac systems do you use? I need something fairly portable with reasonable memory. Can you recommend any mid price (or cheaper) Macs systems that work well for controller programming? Appreciate any suggestions. Thanks.
@profgallaugher
@profgallaugher 23 дня назад
Hi Christopher. I don't use the Community Bundle much. The only time I used it was when I needed a scheduler for Raspberry Pi Pico & it wasn't yet available in CircuitPython. I haven't gotten to updating the "Medications Cabinet" build yet, but if there is an official scheduler library, then I will likely replace the community code with the official one. I'm not sure what is available in terms of examples, etc. You may get a better answer on the Discord community re: this, since there are more folks w/Community Bundle experience there (and likely many who have contributed to it). While I haven't used CircUp with the community bundle, it's referenced in the docs, here, so I imagine that it does work: github.com/adafruit/circup As far as Macs go. About 70-80% of our students use Macs & I teach an iOS class, so that's what I use. The built-in UNIX base has made some things easier. MacBook Air computers are light weight & the Mx chips are powerful. They're regularly upgraded. I'm still using an M1 variant on my computer. My understanding is that some of the new AI stuff might be more RAM intensive, since local LLMs are running locally for privacy concerns, so if you were thinking what to invest more in, I'd consider more RAM, although I don't have any specifics on "what's a good size". There are likely some posts covering this already, somewhere, though. I've been pretty much heads down trying to get the CircuitPython portion of my course revised so I can start on the SwiftUI stuff. I don't have a typical "academic summer" :) Hope that's useful. Cheers!
@christopherlyons7613
@christopherlyons7613 23 дня назад
Thanks so much for your reply. So do you feel the M1 is still a reasonable processor? I really don't need the greatest, would rather save a few $ as long as it works fairly well. I can get a refurbished MacBook Pro M1 10 core CPU/16 core GPU 16G RAM 1TB SSD 14.2 Display for $1300 (excellent condition). That seems reasonable considering the cost of similar specs M2 or M3 MacBook Pros. I know this is over speced for doing development work but I also do video production and lots of other things so I believe this would be good for me. Do you believe the M1 could be at least viable for the next 3-5 years? Really appreciate any guidance. Thank you very much.
@profgallaugher
@profgallaugher 23 дня назад
Mmm. always tough to make a decision for someone else. I'd hate to say go cheaper & then have you find out that some cool new feature can't run on old stuff. I'd definitely get an M-class machine. Not sure if M1s are still being sold. You can likely get a refurbed one, but the latest iPad came with an M4, so the upgrades are happening fairly quickly. You're likely best able to evaluate the financial pain vs. obsolescence risk quota. I have found that the lifespan of Macs was longer, but I think AI throws a wrench into old experiences since it's so processor & memory intensive, and that some of the models may leverage inference engines on the chips. Sorry I can't make an easy "get this!" recommendation. Good luck!
@christopherlyons7613
@christopherlyons7613 23 дня назад
​@@profgallaugherTotally understand. Thanks for your guidance though. It certainly looks like the M1 should work well for me at least for the next 3-5 years. I don't see anything that I currently do that it shouldn't do at least reasonably quickly. It's not perfect but for the reduced price I think it's worth a shot. I may wait till Prime day later this week to see if I can possibly shave off a couple more hundred. Thanks again.
@christopherlyons7613
@christopherlyons7613 3 дня назад
@@profgallaugher Having some trouble getting Circup installed. I get to your 'pip3 install circup' cmd and this ends with the following: Installing collected packages: appdirs, urllib3, toml, semver, idna, findimports, Click, charset-normalizer, certifi, requests, update-checker, circup Successfully installed Click-8.1.7 appdirs-1.4.4 certifi-2024.7.4 charset-normalizer-3.3.2 circup-2.0.4 findimports-2.5.0 idna-3.7 requests-2.32.3 semver-3.0.2 toml-0.10.2 update-checker-0.18.0 urllib3-2.2.2 But I'm NOT seeing the 'successfully installed circup' message. And if I try to run a version command on circup, it says 'zsh: command not found: circup'. And, of course, the 'circup install -a' fails to run. What am I doing wrong? Appreciate any guidance.
@orion72007
@orion72007 24 дня назад
when i run the circuitpython_setboard circuitplayground_express i get nothing
@profgallaugher
@profgallaugher 24 дня назад
Did you go through the easier lesson setting up a PyCharm project’s Python interpreter with circuit-python stubs added? And are you running the latest CircuitPython on your board? It def works with a properly set up project running CircuitPython 9.1. Just tried it out to confirm.
@orion72007
@orion72007 24 дня назад
​@@profgallaugher I will check the version of circuit python on the board and just to be sure, I'll set up a fresh project following through the video again. I am on Windows
@orion72007
@orion72007 24 дня назад
the comand still seems to do nothing however the code completion and code itself seems to be working just fine for now at lest
@profgallaugher
@profgallaugher 23 дня назад
Definitely check out the Adafruit Discord. I'm sure there's someone there who is using your platform & who can provide some friendly, quick advice. Cheers! blog.adafruit.com/2017/07/20/adafruit-is-on-discord-discordapp-adafruit-discord-adafruit/
@orion72007
@orion72007 23 дня назад
@@profgallaugher will do thanks!!
@torque6389
@torque6389 24 дня назад
Subscribed! Love these tutorials.
@profgallaugher
@profgallaugher 24 дня назад
So glad to hear. Thanks for sharing. I’ve been rolling out about one new update from my two year old course each day. Expect many more over the coming weeks. Cheers!
@madlycan
@madlycan 24 дня назад
pretty much a life saver. thank you kind sir.
@jerksnacks5027
@jerksnacks5027 25 дней назад
This is an Music Player app. 15 minutes in and I get that. Newbs watch so title it right. I simply need a simply code to make my sounds play when my app opens. But it seems if it doesnt have a button, or is not a player, it cant be. Is that easy its not worth your time? Would help many, and it is the basic step. First get music to play, then add the buttons. Last, grow it into a player. Sad we cant find this very basic things, but everything else.
@profgallaugher
@profgallaugher 25 дней назад
You can just put the code inside the .onAppear modifier. That fires when a view loads, so if you call the playSound function when the view loads, you should har the sound. You can see examples of this in later projects in the playlist. I'm sure I use it in the "Dog Pics" challenge.
@jerksnacks5027
@jerksnacks5027 24 дня назад
@@profgallaugher That was the most coolest things ever. Thank you for reaching out, and with a solution. After a few fails, did not know it had to go under image. BUT now it works well. And thank you for feeling and understanding my pain as a newb. You are the best!!!!
@AM-jw1lo
@AM-jw1lo 25 дней назад
I ceased to move forward at ls /dev/tty.* on windows 10. in powershell it tells me object does exist and in cmd prompt ls is not a command. at same terminal start location i can run "dir" and see all the files on the board, so it is looking where i expect it.
@profgallaugher
@profgallaugher 25 дней назад
Hmmm. Wish I had a Windows machine to tell you. I know lots of folks on Adafruit discord are windows users who circup. Does ls command show anything? Just by itself? Sorry if you know this but it’s the links equivalent of dir. This is the start of Adafruit’s install guide. You can see. Windows area. Check out pages ahead and after this one, too. learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup/prepare
@profgallaugher
@profgallaugher 25 дней назад
I recall Windows folks mentioning they used the new Windows Terminal that is a free download from the Windows online store. Could it be that has commands that Powershell lacks? I’d try that.
@AM-jw1lo
@AM-jw1lo 25 дней назад
@@profgallaugher Ls command gives a directory call back. So it works with powershell. I used PS commands to get the device name. Are you saying some have Windows Terminal working under PyCharm? otherwise i just have more hoops to jump over/thru, and i can always use Visual Studio, it just would have been nice to follow along with what you are doing in the same ide.
@profgallaugher
@profgallaugher 24 дня назад
Try this: open the PyCharm Terminal. Check to see if pip3 is installed. If not, install it. Then try installing circup right from the PyCharm terminal. I had an issue where it seemed I had one set of stuff installed under Mac Terminal and another from the Terminal in PyCharm. I’d def ask on Adafruit Discord as there are many Windows PyCharm, users. Cheers.
@torque6389
@torque6389 25 дней назад
Great video!
@profgallaugher
@profgallaugher 25 дней назад
Glad you like it. Keep hacking!
@christopherlyons7613
@christopherlyons7613 25 дней назад
Will Circup update libraries when you change to a new CP version if they've changed? Is there a special command to do that or just run normally?
@profgallaugher
@profgallaugher 25 дней назад
After you update CircuitPython to a new version just run circup update -all and it’ll update to any new versions if available. I just did that on a couple boards today after upgrading to CP 9.1, which was released a day or so before I wrote this. Cheers!
@gvenagas
@gvenagas 29 дней назад
Excellent communicability, great experience, full range of courses and very friendly and warm presentation. We thank you! ❤❤❤
@profgallaugher
@profgallaugher 29 дней назад
Thanks for your kind words! Much more content on the way. Cheers!
@tinyhonkshus
@tinyhonkshus Месяц назад
This is great, I'm excited to try it out. I was hoping there might be tidbids about git integration - I get the impression that there's no way to set it up in a "normal" way since you're always writing to the board as you go, but do you have a favorite workflow?
@profgallaugher
@profgallaugher Месяц назад
Thanks so much! I haven’t explored PyCharm’s git integration yet, but hope to. The other course I teach is in Xcode for SwiftUI development and I have all of those students submit their work via GitHub classroom w/Xcode integration. Both courses are for newbies but the iOS course has an easier setup and it’s a pretty natural integration. I’d likely intro git stuff in the PhysComp course after a few weeks so I don’t overwhelm them with setup stuff. Not sure if you work with anyone interested in the basics but I’m in the process of re-creating all my intro lessons at bit.ly/circuitpython-tutorials and if/when I get to git I’ll add it there. Rushing to get as far as I can in rework this month so I can also rework the iOS stuff next month for the start of Fall classes. Peace.
@glennmeader626
@glennmeader626 Месяц назад
I notice Adafruit is no longer designing “all in one” boards like the pygamer, PyBadge and PyPortal. There are plenty of competitors offering such: the LilyGo And Waveshare ESP32-S3 Touch LCD dev boards. However, circuitpython is not yet available for download to these boards, a bunch of work has to be done to configure circuit Python for new boards. I looked at the documented process and it over my head…
@Keeping_IT_Simple
@Keeping_IT_Simple Месяц назад
Pycharm or Thonny? what are the advantages / disadvantage of each?
@profgallaugher
@profgallaugher Месяц назад
I’ve struggled to get Thonny to work reliably w/CirciitPython boards and others have said the same. PyCharm is a tool used by many Python professionals outside of electronics. A good match for my students, many of whom will use Python outside their electronics work, too.
@Keeping_IT_Simple
@Keeping_IT_Simple Месяц назад
@@profgallaugher thank you so much for taking the time to let me know what sort of problems did you find using Circuit Python with Thonny i wonder?
@profgallaugher
@profgallaugher Месяц назад
I had difficulty getting it to work reliably. Here is Todbot (Tod Kurt) from Adafruit speaking on a podcast - he mentions the same thing. I've noticed many (although certainly not all) of the devs at Adafruit use PyCharm for their own work, too. thebootloader.net/blog/2024/07/01/four-topics-and-an-interview/
@Keeping_IT_Simple
@Keeping_IT_Simple Месяц назад
@@profgallaugher thanks again for getting back to me. Will certainly give pycharn a look , although my programming "skills" are far far inferior to the exalted ones at Adafruit & yourself of course
@profgallaugher
@profgallaugher 28 дней назад
Ha! I wouldn't call me an exhausted one :) I"m always learning and make a ton of mistakes. I will say that even though PyCharm has lots of features, I tell my students "ignore the things you don't need". I really like the code-completion & error handling. I found that Mu was just too limited & that my students made lots of mistakes that PyCharm could have caught. I won't know for sure until after this semester, but I also teach an iOS apps course for new programmers using Xcode. Xcode is Apple's professional development environment (IDE), and its features like code completion & error reporting/correction have helped the iOS students do more than the CircuitPython students. I'm expecting this semester that we'll have more of a balance after switching to PyCharm. I'm still noticing some quirky things. For example, sometimes Tio used via PyCharm's Terminal doesn't exit properly - but usually just exiting PyCharm, unplugging the board and plugging it back in, will re-set everything. Good luck!
@alzearafat
@alzearafat Месяц назад
This channel is underrated. Thank you Prof, I learned a lot.
@profgallaugher
@profgallaugher Месяц назад
Thanks so much! Comments like this keep me motivated. I’m updating my electronics programming course with CircuitPython so you’ll see videos for that over the next few weeks, but I will definitely be switching to SwiftUI prep for Fall, soon. I like to do that the second half of the summer since it gives a longer period for the bugs on the new Xcode and SDKs to shake out. Stay tuned & feel free to share with others. Peace!
@eklabofficial
@eklabofficial Месяц назад
Could you possibly give me some links for all the pieces needed?
@profgallaugher
@profgallaugher Месяц назад
Look at the Google sheet link in the very first video at bit.ly/circuitpython-tutorials (it’s in the video description - those are below the RU-vid videos. Sometimes you have to click to expand them). That link has all of the parts, links, etc.
@eklabofficial
@eklabofficial Месяц назад
@@profgallaugher Is it ok to buy a Pico WH because that is what the link takes me to that was on the spreadsheet.
@profgallaugher
@profgallaugher Месяц назад
That's the one to get. It has the headers pre-soldered on it. You'll want to get a breadboard, too. If you're just experimenting, the CircuitPlayground Bluefruit (CPB) board is a great first board. The CircuitPython you'll learn will mostly translate to the Raspberry Pi Pico, but the CPB has a bunch of sensors, lights, and other hardware on board, and it can be easily expanded with alligator clips. Feel free to use either, or both, but the CPB is a great first choice given it has so much embedded in it. CircuitPython will be mostly standard across the >500 boards that run the language.
@profgallaugher
@profgallaugher Месяц назад
Know that the Raspberry Pi Pico-WH doesn't do a whole lot on its own. You'll likely want some additional hardware if that's the one. you go with. Get a breadboard, a neopixel light strip, pin-alligator clip wires, and most of the sensors I use (e.g. the 12-pad touch sensor, distance sensor, etc) use the STEMMA-QT standard, so this product is good to use with STEMMA-QT expansion since these devices can be daisy-chained together. www.adafruit.com/product/4209. You'll also need a STEMA-QT cable to go from the port on that product to any of the STEMMA-QT expansion items - something like this will work: www.adafruit.com/product/4210 Again, the CPB is really nice as a first board because it includes so much & you can experiment with motional detection / accelerometer, lights, sounds, light sensing, buttons, and more, all on the board. This may make it easier to choose hardware for a board like the Pico-WH in the future. Cheers & good luck. Also know that Adafruit Discord is a GREAT place to ask for help. I mention this site in the intro videos.
@eklabofficial
@eklabofficial Месяц назад
@@profgallaugher I already have A CPB do you recommend any buttons on adafruit that could hook up to alligator clips.
@eklabofficial
@eklabofficial Месяц назад
Could you give me a link for purchasing one on adafruit(just so I'm getting the correct one)?
@christopherlyons7613
@christopherlyons7613 Месяц назад
Is there a reason you prefer PyCharm to VSCode? What does PyCharm do that VSCode doesn't?
@profgallaugher
@profgallaugher Месяц назад
You could use VS Code if you’d like. It seems like most of the folks at Adafruit use PyCharm. It’s specifically designed for python. You can add some plug ins to VS Code to get similar functionality but I’ve been told the PyCharm setup and config is easier so I’m using that. Also it’ll be easier for my students to ask support Qs in PyCharm if most in Discord use that tool. You should feel free to investigate VSCode if that’s what you’re most comfortable with. They did try a VS Code add on for CircuitPlayground boards a few years back but it was created by interns, never supported, and I couldn’t get it to work.
@billtudor1953
@billtudor1953 19 дней назад
To echo what the prof said, VSCode is more than a text editor, but not quite an IDE. You can stack enough plugins on VSCode to get Pycharm, but it wasn't built for a specific purpose. It's the difference in using a crescent wrench or a 16mm deep socket.
@davidpulcifer3792
@davidpulcifer3792 12 дней назад
To offer the other side of the picture. I develop with Python on VSCode regularly. I didn't like the development experience on Pycharm when I tried it a while back and found it much easier to manage python versions and virtual environments with VSCode. So, I was very interested in getting this to work with VSCode. I already had the Python extension installed in VSCode, so all I had to do was install the CircuitPython extension and I was up and running, including serial monitor. (Note that the 0.2.0 version of the CircuitPython extension is broken, install the 0.1.2 version instead)
@christopherlyons7613
@christopherlyons7613 Месяц назад
Seems like you're releasing a new set of CircuitPython videos. Just to help keep everything together can you create a new playlist for these new videos? Thanks.😊
@profgallaugher
@profgallaugher Месяц назад
What I plan to do is replace all of the old videos at bit.ly/circuitpython-school with new videos as they are created. I won’t delete the old ones but I will remove them from the playlist just in case other faculty have them linked to their syllabi. You should see the new videos in order as they roll out using the original playlist url. I’ll be updating the CPB list before the Raspberry Pi Pico material. Cheers!