Pi pico therapy timer and C vs. micro python

Sdílet
Vložit
  • čas přidán 16. 10. 2023
  • The pico advance kit I talked about -- Available with or without a Pi Pico:
    www.elecrow.com/raspberry-pi-...
    Building the box for the timer:
    • Wooden project box for...

Komentáře • 116

  • @marksilverman
    @marksilverman Před 7 měsíci +43

    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  Před 7 měsíci +21

      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 Před 7 měsíci +5

      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 Před 7 měsíci +5

      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 Před 7 měsíci

      @@matthiasrandomstuff2221 or better yet - just use CORDIC ;-)

    • @Ice_Karma
      @Ice_Karma Před 7 měsíci +3

      @@anon_y_mousse Make them program for embedded systems, in C and assembler. 😹

  • @folby
    @folby Před 7 měsíci +15

    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 Před 7 měsíci +1

      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 Před 3 měsíci

      Does therapy even work? It’s advice isn’t it?

  • @q3kq3k
    @q3kq3k Před 7 měsíci +22

    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 Před 7 měsíci +11

      that feeling when a yt comment solves a problem you were having. thanks for the info.

    • @matthiasrandomstuff2221
      @matthiasrandomstuff2221  Před 7 měsíci +8

      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 Před 7 měsíci +16

      @@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 Před 7 měsíci +3

    4:05 lol I love the improvised heatsink!

  • @jsmxwll
    @jsmxwll Před 7 měsíci +15

    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.

  • @tracybowling1156
    @tracybowling1156 Před 7 měsíci +5

    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.

  • @cjhoyle
    @cjhoyle Před 7 měsíci +4

    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.

  • @C1Ansy
    @C1Ansy Před 7 měsíci

    The elecrow kit is actually really useful for getting started. I will buy this.
    Thank you for sharing!

  • @NotaRobot_gif
    @NotaRobot_gif Před 7 měsíci

    I love these little programing projects. Showing us more details on how you promgrammed would be always appreciated! Thanks!

  • @IdRatherBeMaking
    @IdRatherBeMaking Před 7 měsíci

    Nice! I love the idea, a soft way to indicate the time.

  • @MCsCreations
    @MCsCreations Před 7 měsíci

    Fascinating stuff indeed! Thanks, Matthias! 😃
    I guess I'm going to need to learn Python!
    Stay safe there with your family! 🖖😊

  • @kevinetheridge6153
    @kevinetheridge6153 Před 7 měsíci +3

    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.

  • @dege13
    @dege13 Před 7 měsíci +7

    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  Před 7 měsíci +2

      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 Před 7 měsíci +1

      I could really use something like that to avoid data overage!

  • @droko9
    @droko9 Před 7 měsíci +9

    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  Před 7 měsíci +12

      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 Před 7 měsíci

      @@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 Před 7 měsíci +3

    I bought a esp32 kit like that about 6 months ago. it's handy for figuring out all the sensors for a project

  • @tardigrades3184
    @tardigrades3184 Před 7 měsíci

    I remember as a kid I loved looking at a nightlight which had its colors fade into each other. Very satisfying.

  • @TheVoidSinger
    @TheVoidSinger Před 7 měsíci +2

    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

  • @okraneker
    @okraneker Před 7 měsíci +3

    "Not sure where this PCB came from" Just a wild guess but there is some silkscreen "GAGGIA" and "Coffee" ;)

  • @gustinian
    @gustinian Před 3 měsíci +1

    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..

  • @RookieLock
    @RookieLock Před 7 měsíci

    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 Před 7 měsíci +9

    Python is great for fast prototyping. You can always plug in a c library if you need to.

  • @BartvandeMosselaar
    @BartvandeMosselaar Před 7 měsíci

    more in depth, nice!

  • @chirots
    @chirots Před 7 měsíci

    Great project.

  • @Zgembo121
    @Zgembo121 Před 7 měsíci +4

    U should be a high school tech teacher. People who have ideas for projects like this are in huge demand

    • @matthiasrandomstuff2221
      @matthiasrandomstuff2221  Před 7 měsíci +11

      why should I teach this sort of thing to kids that aren't interested in it?

    • @ssl3546
      @ssl3546 Před 7 měsíci +2

      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 Před 7 měsíci +1

      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 Před 7 měsíci

      ​@@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 Před 7 měsíci +2

      @@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

  • @JernD
    @JernD Před 7 měsíci +8

    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.

  • @LeesChannel
    @LeesChannel Před 7 měsíci

    Wow, I really wasn't expecting the pivot into advertising a pico bundle.

  • @GeorgeLeite
    @GeorgeLeite Před 7 měsíci +2

    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

  • @phookadude
    @phookadude Před 7 měsíci +6

    So the Python is sort of like basic on all the 80's 8 bit computers.

  • @fuzzy1dk
    @fuzzy1dk Před 7 měsíci +3

    1:41 it doesn't have an FPU but it has a floating point lib in ROM so using floats is not that bad

  • @McClimber234
    @McClimber234 Před 7 měsíci

    These projects/videos are so cool. Thx

  • @Sam_596
    @Sam_596 Před 7 měsíci +5

    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 Před 7 měsíci +1

      Indeed. It is a useful language, but definitely still sucks and should be limited in use.

  • @RooMan93
    @RooMan93 Před 7 měsíci

    I cant wait to see your opinion on the RPi 5

    • @matthiasrandomstuff2221
      @matthiasrandomstuff2221  Před 7 měsíci +10

      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 Před 7 měsíci +3

      @@matthiasrandomstuff2221 also it doesn't need as much cooling as 5 or even 4

  • @stellamcwick8455
    @stellamcwick8455 Před 7 měsíci

    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”.

  • @AboubakrA
    @AboubakrA Před 7 měsíci

    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

  • @bmxscape
    @bmxscape Před 7 měsíci +4

    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  Před 7 měsíci +3

      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 Před 7 měsíci

      @@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

  • @kylewollman2239
    @kylewollman2239 Před 7 měsíci

    very cool

  • @piconano
    @piconano Před 7 měsíci +1

    ESP32 runs RTOS. Long live C/C++.
    Programs running under Python, is like running a sports car on wood gas!

  • @billsmith5166
    @billsmith5166 Před 7 měsíci

    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?

  • @donaldklopper
    @donaldklopper Před 7 měsíci +4

    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 Před 7 měsíci +1

      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.

  • @robertvanderzaan9681
    @robertvanderzaan9681 Před 7 měsíci

    I missed the combination for pause or does that never happen?

  • @bcoda
    @bcoda Před 7 měsíci

    Another example of asking if they could but not if they should.

  • @alexpr0gressive
    @alexpr0gressive Před 7 měsíci +1

    Did you try Apache licensed RTOS (Realtime operating system) NuttX

    • @matthiasrandomstuff2221
      @matthiasrandomstuff2221  Před 7 měsíci +4

      its not the RTOS functionality I'm after. its stuff like file system, networking, sockets, that sort of thing.

  • @bsekisser
    @bsekisser Před 7 měsíci +1

    Well... Forth that... Or even roll your own!... Depending on your needs.

    • @craig4320
      @craig4320 Před 7 měsíci

      Yes, FORTH is a great fit to microprocessor programming. I wish there were a youtube creator whith that focus

  • @lightdark00
    @lightdark00 Před 7 měsíci +2

    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  Před 7 měsíci +5

      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 Před 7 měsíci +1

      @@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 Před 7 měsíci

      @@lightdark00 Think of button sequences as a binary input somewhat akin to Huffman coding and you'll understand the utility.

    • @lightdark00
      @lightdark00 Před 7 měsíci

      @@anon_y_mousse Most my buttons on projects are interrupts, so I like to keep it simple to understand instead of patterns.

  • @MaxMakerChannel
    @MaxMakerChannel Před 7 měsíci

    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  Před 7 měsíci +2

      Less suitable because its more expensive and bigger.
      The pi pico is pretty cheap and doesn't have an operating system

  • @BeeRich33
    @BeeRich33 Před 7 měsíci

    Run your potential cider factory from a handful of Picos. Heh.

  • @stcredzero
    @stcredzero Před 7 měsíci

    300k, 740k are pretty typical sizes for language runtimes.

  • @kosodrzewinka
    @kosodrzewinka Před 2 měsíci

    Great project! Would you be willing to share the code?

  • @henryD9363
    @henryD9363 Před 7 měsíci

    Wow! The kit is like 30 to 50ish dollars.

  • @naher1277
    @naher1277 Před 7 měsíci

    Just how many pis do you have?

  • @MultiKlompen
    @MultiKlompen Před 7 měsíci

    Why do you use rasperry pi?
    Wheres the difference to arduino?

  • @catman08724
    @catman08724 Před 7 měsíci

    Matthias video 1 minute ago?? Don't mind if I do

  • @TheHayes32
    @TheHayes32 Před 7 měsíci

    I would think this is a silly way to tune a therapy session.

  • @darrenjowett8032
    @darrenjowett8032 Před 7 měsíci

    Can you make a cure for cancer I’m sure you could ❤

  • @roboman2444
    @roboman2444 Před 7 měsíci +6

    Alternatively, an old school analog clock with no second hand would probably work just as well for avoiding being "attention grabbing".

    • @JohnMGibby
      @JohnMGibby Před 7 měsíci +1

      Except kids these days can't tell time on an analog clock

    • @MrIanrocks
      @MrIanrocks Před 7 měsíci +4

      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

  • @matambale
    @matambale Před 7 měsíci +3

    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  Před 7 měsíci +5

      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 Před 7 měsíci +1

      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 Před 6 měsíci

      ​​@@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

  • @Guywithcrazyideas
    @Guywithcrazyideas Před 7 měsíci +1

    So I watched this video and only understood that I crave pumkin pie with cream on top.

  • @markifi
    @markifi Před 7 měsíci

    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

  • @vmoutsop
    @vmoutsop Před 7 měsíci

    My head hurts

  • @d.i.l.l.i.g.a.f
    @d.i.l.l.i.g.a.f Před 7 měsíci

    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  Před 7 měsíci +1

      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 Před 7 měsíci

      @@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

  • @jairsouza7108
    @jairsouza7108 Před 7 měsíci

    Nunca mais vai postar um bom vídeo ??😅

  • @mk6595
    @mk6595 Před 7 měsíci +2

    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  Před 7 měsíci +6

      The whole idea is that you dont actually KNOW the time, and you can see the color without even looking at it.

  • @Graham1904
    @Graham1904 Před 3 měsíci

    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.