Тёмный

Pi pico therapy timer and C vs. micro python 

Matthias random stuff
Подписаться 210 тыс.
Просмотров 30 тыс.
50% 1

The pico advance kit I talked about -- Available with or without a Pi Pico:
www.elecrow.co...
Building the box for the timer:
• Wooden project box for...

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 117   
@marksilverman
@marksilverman 11 месяцев назад
doing stuff in "integer math" was really important back in the day. Even if your CPU could handle floating point numbers, it was much faster to use integers. This came up in a computer graphics class I took in college in the late 90's; we had to draw a circle using only points and do all the trig with no floating point math.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
that's not even a hard one. no trig required, just use the pythagorean theorem. And if your chip doesn't have a multiplier, you can get from one square to the next by adding terms in an arithmetic series
@anon_y_mousse
@anon_y_mousse 11 месяцев назад
Those were fun times weren't they. Although, a fair few tricks I learned back then for optimization still work now, even as good as modern compilers are. I just wish I could send the latest generation back to those times to learn.
@marksilverman
@marksilverman 11 месяцев назад
Oh right, you don't need trig at all. And you only need to iterate for a quarter of the circle and plot (x,y), (-x,y), (x, -y), and (-x,-y).
@akkudakkupl
@akkudakkupl 11 месяцев назад
@@matthiasrandomstuff2221 or better yet - just use CORDIC ;-)
@Ice_Karma
@Ice_Karma 11 месяцев назад
@@anon_y_mousse Make them program for embedded systems, in C and assembler. 😹
@folby
@folby 11 месяцев назад
as a therapist I will only note that sometimes you want the client to be aware of the passage of time, as the knowledge that there's only X minutes remaining can push them to disclose something they were hesitant to bring up, or allow you to pivot from "I have listened and validated as you have complained but let's talk a bit about what you can do to deal with this problem." regardless, a very neat project and on balance probably better for the office than a clock.
@Tibug
@Tibug 11 месяцев назад
As well as knowing the remaining time is important for the planning. 5 min to the end, you don't open the next treasure trove.
@mookfaru835
@mookfaru835 7 месяцев назад
Does therapy even work? It’s advice isn’t it?
@q3kq3k
@q3kq3k 11 месяцев назад
The cool thing about the RP2040 is that its flash memory is not integrated, and is implemented by a discrete NOR QSPI flash chip. This means that if you run out of flash, you can just buy a bigger flash chip. A 128Mbit W25Q128 is
@jsmxwll
@jsmxwll 11 месяцев назад
that feeling when a yt comment solves a problem you were having. thanks for the info.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
bit if you are buying pre-made boards, you can't just buy a chip for $2 in single quantities and swap it out
@q3kq3k
@q3kq3k 11 месяцев назад
@@matthiasrandomstuff2221 I mean, you can, but yeah, it takes being somewhat comfortable with SMD rework - which is a hobby and skill in itself. But another side effect of this is that there's now a bunch of RPi Pico clones with the full 128Mbit of NOR available (keyword is 'pico 128mbit' or 'ultimate pico' in the typical places). And they're still the same chip otherwise, so you're not buying into a weird obscure ecosystem.
@JeffGeerling
@JeffGeerling 11 месяцев назад
4:05 lol I love the improvised heatsink!
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
surprisingly effective
@tracybowling1156
@tracybowling1156 11 месяцев назад
The only thing I understood was Commodore 64. One of which I had. My Dad was super smart (like you Mattias) and he made sure we had any/every game possible! That's why I like these videos. They remind me of him.
@jsmxwll
@jsmxwll 11 месяцев назад
i love how quickly you can itterate with micropython on a pico. i've also gotten a different kit from elecrow and it was a great buy. a nice selection of bits for a lot less than trying to piece them all together given that it is often hard to just get one of something to try.
@cjhoyle
@cjhoyle 11 месяцев назад
I was given a kit similar to that shortly after I got my first Raspberry Pi. It was a great introduction for learning to use devices/sensors with the Pi. I have collected many other devices since then.
@NotaRobot_gif
@NotaRobot_gif 11 месяцев назад
I love these little programing projects. Showing us more details on how you promgrammed would be always appreciated! Thanks!
@okraneker
@okraneker 11 месяцев назад
"Not sure where this PCB came from" Just a wild guess but there is some silkscreen "GAGGIA" and "Coffee" ;)
@kevinetheridge6153
@kevinetheridge6153 11 месяцев назад
I'm really interested in this / excited by the possibilities. I haven't done any C programming and it's been a long time since I did any Python - but I'm less intimidated by that. I fancy the idea of being able to use something like this to do small, fun learning experiments. Thanks, as always for the interesting and educational content.
@tardigrades3184
@tardigrades3184 11 месяцев назад
I remember as a kid I loved looking at a nightlight which had its colors fade into each other. Very satisfying.
@dege13
@dege13 11 месяцев назад
I used 3 LEDs much like that traffic light module on my pihole to show the internet connection health based on a ping script.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
that's a neat idea. I have been thinking about what sort of status I could blink with leds on the pi's I have, but can't think of a status I want to check a lot
@poiiihy
@poiiihy 11 месяцев назад
I could really use something like that to avoid data overage!
@droko9
@droko9 11 месяцев назад
Thats funny, I ran through the same sequence of decisions when I started using micropython. I avoided it out of principle but it turns out you can get a lot more work done if you don't have a performance requirement
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
I need to play with it some more to get a sense of what it's good for. Had a hell of a time getting wifi to work on the pico with C, and then the router started ignoring it after 18 hours. could not tcp connect to it, but could still ping it. No idea what I did wrong.
@matambale
@matambale 11 месяцев назад
@@matthiasrandomstuff2221 Had *exactly* the same experience with a Pi zero W. Went through every bit of config with a fine-toothed comb. No idea what I must have missed. Couldn't find any stray packets with Wireshark.
@UberAlphaSirus
@UberAlphaSirus 11 месяцев назад
I bought a esp32 kit like that about 6 months ago. it's handy for figuring out all the sensors for a project
@C1Ansy
@C1Ansy 11 месяцев назад
The elecrow kit is actually really useful for getting started. I will buy this. Thank you for sharing!
@RookieLock
@RookieLock 11 месяцев назад
I recently got interested in raspberry projects.. most related to ham radio, but would love to explore other projects. Thanks for the inspiration.
@mc_cpu
@mc_cpu 11 месяцев назад
Python is great for fast prototyping. You can always plug in a c library if you need to.
@LeesChannel
@LeesChannel 11 месяцев назад
Wow, I really wasn't expecting the pivot into advertising a pico bundle.
@gustinian
@gustinian 7 месяцев назад
Matthias - for a compromise between the speed of C and the facility of Micro Python, try Mecrisp Forth instead. Forth has plenty of advantages over both C (interactive) and Micro Python (speed and bloat), and is refreshingly fascinating in its unique threaded code approach for rapid development..
@TheVoidSinger
@TheVoidSinger 11 месяцев назад
Wait till you hit the availability wall for libraries... CircuitPython (technically a MicroPython fork) has more libraries available for different sensors/hardware, but doesn't handle threading nor have great support for PIO. MicroPython handles both of those, but is a barren desert for many sensor libraries meaning you either have to port, or write your own in C... Both are great for what they do support, but if you do anything outside of that you might as well go back to C
@IdRatherBeMaking
@IdRatherBeMaking 11 месяцев назад
Nice! I love the idea, a soft way to indicate the time.
@JernD
@JernD 11 месяцев назад
I use python a lot, and it is the most enjoyable language I have ever used. String manipulation is so easy and f-strings are fantastic. Would love to hear your opinion/experience on using micropython if you continue to use it more in projects.
@MCsCreations
@MCsCreations 11 месяцев назад
Fascinating stuff indeed! Thanks, Matthias! 😃 I guess I'm going to need to learn Python! Stay safe there with your family! 🖖😊
@Zgembo121
@Zgembo121 11 месяцев назад
U should be a high school tech teacher. People who have ideas for projects like this are in huge demand
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
why should I teach this sort of thing to kids that aren't interested in it?
@ssl3546
@ssl3546 11 месяцев назад
so instead of reaching 2 million people (on his main channel) and having time to develop these projects, he should reach 100 kids most of whom don't care and he should not have time to develop these projects? what?
@JonnyDIY
@JonnyDIY 11 месяцев назад
You find the right school with the right electronics/engineering department plenty of kids would love to learn and pick your brain. You really do have a gift for it, I remember telling you that mannnny years ago as I'm sure many have. Something to think about for the future. Be a good gig
@Zgembo121
@Zgembo121 11 месяцев назад
​@@matthiasrandomstuff2221 Im in the process of doing a career change (cnc / robotics to teacher) and kids are interested. These high school subjects are an elective subject, where students can learn / pursue their interest, and when they see projects such as the ones you made, that peaks their interests, they show it to their friends and more students take those classes. Lot of time the course grows because of the teacher and the projects that the teacher pics
@Zgembo121
@Zgembo121 11 месяцев назад
@@ssl3546 my point was not that he should stop this channel and teach, but to teach additionally to this channel as he has the passion for the subject and language skills to be a great teacher. with projects that ive seen on the channels studnes would deffinitely be interestd as these tech classes are an elective, and students can keep these projects and be proud of what they made
@phookadude
@phookadude 11 месяцев назад
So the Python is sort of like basic on all the 80's 8 bit computers.
@chirots
@chirots 11 месяцев назад
Great project.
@fuzzy1dk
@fuzzy1dk 11 месяцев назад
1:41 it doesn't have an FPU but it has a floating point lib in ROM so using floats is not that bad
@stellamcwick8455
@stellamcwick8455 11 месяцев назад
You should make a version for lawyers. Instead of colors you can make it play a cash register sound every minute and at the turn of every hour it plays the opening bass riff from Pink Floyd’s “Money”.
@bcoda
@bcoda 11 месяцев назад
Another example of asking if they could but not if they should.
@Sam_596
@Sam_596 11 месяцев назад
I have no issues with python as a rapid prototyping language (well, there's the syntactic whitespace thing, but that's another issue). It's when people refuse to learn other languages and try to use it as a universal language when other languages would be better suited that gets on my nerves
@anon_y_mousse
@anon_y_mousse 11 месяцев назад
Indeed. It is a useful language, but definitely still sucks and should be limited in use.
@GeorgeLeite
@GeorgeLeite 11 месяцев назад
Thinking of building this with an esp32 or 8266 to run an http server to control it with a web page. I run weekend retreats that have varying times. But a subtle reminder would be great
@piconano
@piconano 11 месяцев назад
ESP32 runs RTOS. Long live C/C++. Programs running under Python, is like running a sports car on wood gas!
@BartvandeMosselaar
@BartvandeMosselaar 11 месяцев назад
more in depth, nice!
@bsekisser
@bsekisser 11 месяцев назад
Well... Forth that... Or even roll your own!... Depending on your needs.
@craig4320
@craig4320 11 месяцев назад
Yes, FORTH is a great fit to microprocessor programming. I wish there were a youtube creator whith that focus
@donaldklopper
@donaldklopper 11 месяцев назад
That kit really isn't expensive... I think in the price range of a really decent gift? Why oh why don't the kids want to learn programming?
@MMuraseofSandvich
@MMuraseofSandvich 11 месяцев назад
Getting their interests connected to the technology is the first hurdle. Usually I can get a few kids in a classroom by teaching them how to make Minecraft mods. The second hurdle is the realization that programming what they _actually_ want will feel overwhelming. That, I can't do much about.
@RooMan93
@RooMan93 11 месяцев назад
I cant wait to see your opinion on the RPi 5
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
I'm not in a rush to get one. For most of the stuff I do, a pi 3 is plenty. and the pi 3 has a proper and less fragile HDMI connector.
@Karaon
@Karaon 11 месяцев назад
@@matthiasrandomstuff2221 also it doesn't need as much cooling as 5 or even 4
@lightdark00
@lightdark00 11 месяцев назад
I hate button sequences. I use either timed buttons for up to three options, or toggle buttons, that can be tapped as many times as needed for the number of options needed.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
Timed buttons are really only practical for short and long clicks, not three lengths. Toggles are only useful if you have a display to show what you are toggling on.
@lightdark00
@lightdark00 11 месяцев назад
@@matthiasrandomstuff2221 I never had an issue with three click lengths. And you had a display...the light. A pulse of light after each button press would be all that's needed. alternatively it can pulse the number of presses and reset at the max.
@anon_y_mousse
@anon_y_mousse 11 месяцев назад
@@lightdark00 Think of button sequences as a binary input somewhat akin to Huffman coding and you'll understand the utility.
@lightdark00
@lightdark00 11 месяцев назад
@@anon_y_mousse Most my buttons on projects are interrupts, so I like to keep it simple to understand instead of patterns.
@Graham1904
@Graham1904 7 месяцев назад
Well done on rhe video. I am just started with Pico W and micro python myself so your summarize at the end was great. Thank you to Elgrow(?) for sending the kit.
@MaxMakerChannel
@MaxMakerChannel 11 месяцев назад
Don´t you think a Arduino would be more suitable for this project since its so simple? You don´t need the operating system on a Raspberry pi.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
Less suitable because its more expensive and bigger. The pi pico is pretty cheap and doesn't have an operating system
@stcredzero
@stcredzero 11 месяцев назад
300k, 740k are pretty typical sizes for language runtimes.
@kylewollman2239
@kylewollman2239 11 месяцев назад
very cool
@bmxscape
@bmxscape 11 месяцев назад
i just got a very similar kit to that pi PICO except it's using arduino uno instead of a pi. do you have any experience with arduino or know of any pros and cons vs a pi and a similar arduino? this was my first step into the door of creating my own electronics and it seems i can do many of the same tasks as your pi with the arduino (it comes with pretty much all of the exact same sensors you have) i've also recently got an arduino micro which appears to be a similar form factor as your pi Pico
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
with the arduino, if you decide to use some library from adafruit (they are all bloated), you pretty much have the chip nearly filled. So no pulling in a second library.
@bmxscape
@bmxscape 11 месяцев назад
@@matthiasrandomstuff2221 using the "Arduino IDE" it has a library section which allows you to import many use-case specific libraries. for simple HID or robotics tasks it seems to work well. i am sure ill find the limitations soon
@kosodrzewinka
@kosodrzewinka 6 месяцев назад
Great project! Would you be willing to share the code?
@BeeRich33
@BeeRich33 11 месяцев назад
Run your potential cider factory from a handful of Picos. Heh.
@billsmith5166
@billsmith5166 11 месяцев назад
How about a temperature and humidity bandana that the counselee can wear to monitor his stress and a shaker in your brothers seat so he can be ready to jump up and run out of the room if it senses that the session is headed south?
@alexpr0gressive
@alexpr0gressive 11 месяцев назад
Did you try Apache licensed RTOS (Realtime operating system) NuttX
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
its not the RTOS functionality I'm after. its stuff like file system, networking, sockets, that sort of thing.
@AboubakrA
@AboubakrA 11 месяцев назад
can you please elaborate on the square-root of the color sequence trick you used, I didn't really get what you did and why was that better
@henryD9363
@henryD9363 11 месяцев назад
Wow! The kit is like 30 to 50ish dollars.
@roboman2444
@roboman2444 11 месяцев назад
Alternatively, an old school analog clock with no second hand would probably work just as well for avoiding being "attention grabbing".
@JohnMGibby
@JohnMGibby 11 месяцев назад
Except kids these days can't tell time on an analog clock
@MrIanrocks
@MrIanrocks 11 месяцев назад
The idea is that the therapist has an idea of the time without ever really taking their attention off of their client. To read a clock you need to devote at least a little attention to it
@robertvanderzaan9681
@robertvanderzaan9681 11 месяцев назад
I missed the combination for pause or does that never happen?
@TheHayes32
@TheHayes32 11 месяцев назад
I would think this is a silly way to tune a therapy session.
@darrenjowett8032
@darrenjowett8032 11 месяцев назад
Can you make a cure for cancer I’m sure you could ❤
@catman08724
@catman08724 11 месяцев назад
Matthias video 1 minute ago?? Don't mind if I do
@Guywithcrazyideas
@Guywithcrazyideas 11 месяцев назад
So I watched this video and only understood that I crave pumkin pie with cream on top.
@MultiKlompen
@MultiKlompen 11 месяцев назад
Why do you use rasperry pi? Wheres the difference to arduino?
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
cheaper and much faster
@MultiKlompen
@MultiKlompen 11 месяцев назад
@@matthiasrandomstuff2221 Danke
@McClimber234
@McClimber234 11 месяцев назад
These projects/videos are so cool. Thx
@naher1277
@naher1277 11 месяцев назад
Just how many pis do you have?
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
A lot. Also quite a few picos because they don't cost much.
@markifi
@markifi 11 месяцев назад
i know it's not a logical thing but i would never trust this to count down the right amount of time in a therapy session
@d.i.l.l.i.g.a.f
@d.i.l.l.i.g.a.f 11 месяцев назад
If only your BIL could have waited a month, Pretty sure a knock off version will be available from a certain country for a couple of bucks including postage, Cynical i know lol
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
its a niche product, no sense knocking it off.
@d.i.l.l.i.g.a.f
@d.i.l.l.i.g.a.f 11 месяцев назад
@@matthiasrandomstuff2221 If they think they can make only a few bucks, that has never stopped them yet lol, But I think your odds & ends of wood version looks better than the $80 commercial version, They are pricing them like an intricate electronic medical device. when its only a colour changing lamp with a timer. Complete Rip Off
@mk6595
@mk6595 11 месяцев назад
No offense, but a clock-based timer with hands, or just one hand, is a better therapy session tool. A quick glance shows exactly how much time is left. A clock face is very intuitive. Something with glowing lights has to first be interpreted and then a vague sense of time left is estimated. It could still be an electronics project with a clock face on an LED display.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
The whole idea is that you dont actually KNOW the time, and you can see the color without even looking at it.
@vmoutsop
@vmoutsop 11 месяцев назад
My head hurts
@matambale
@matambale 11 месяцев назад
Python is a slow, fat, scripting language. It apparently eats away at a lot of development time for some people. This bonus is understandable. Still, a batch language sure eats up a lot of processing power spent on interpreting instead of direct execution. Seems like a poor software response to ever more powerful hardware: bloat it all down so it's comparable to a c64. Yours truly, A dinosaur. PS: even I wish I'd shut up on this topic, but it still bugs me - much prefer raw performance in embedded HW/SW development. Squeeze out every last milliMIP.
@matthiasrandomstuff2221
@matthiasrandomstuff2221 11 месяцев назад
it depens on how much the code ens up running. If its for an experiment that will run less than 10 hours, even nergy wise its not a win cause the PC used to develop the sw eats 100x as much power.
@phobos.anomaly
@phobos.anomaly 11 месяцев назад
Python isn't a scripting language though, it's a programming language. It's compiled to bytecode which is run in a VM, much like Java and C#. Yes, that also applies to MicroPython. It is noticeably slower than C, true. But development time is _much_ reduced. And for one-off hobby projects, programmer time is much more expensive than processer time. It really depends on the situation which is more appropriate. I say this as someone with extensive experience in both Python and C. Honestly, I'd like to see more Rust for MCUs. Seems to have some advantages from both languages.
@Grahamaan27
@Grahamaan27 10 месяцев назад
​​@@phobos.anomalyit's definitely not compiled to bytecode and is 100% interpreted like a scripting language. Not sure where you got your info but double check your info. The difference between scripting and programming is really ambiguous and really just semantics
@jairsouza7108
@jairsouza7108 11 месяцев назад
Nunca mais vai postar um bom vídeo ??😅
Далее
I Built a Marble Machine that Makes Pixel Art
16:59
Просмотров 315 тыс.
🎙Пою РЕТРО Песни💃
3:05:57
Просмотров 1,3 млн
这位大哥以后恐怕都不敢再插队了吧…
00:16
Turning a Raspberry Pi Pico into a GPU!
16:42
Просмотров 124 тыс.
Every Developer Needs a Raspberry Pi
27:27
Просмотров 653 тыс.
Hacking my garage door with the Raspberry Pi Pico W
11:50
This is how you destroy Raspberry Pi
9:10
Просмотров 462 тыс.