Charlotte Swift
Charlotte Swift
  • 156
  • 17 783

วีดีโอ

Using decorators in (micro)python. I made this video for myself but you're welcome to watch it.
มุมมอง 82วันที่ผ่านมา
I'm including the listing of my decorators so you don't have to watch the video. from functools import wraps import functools import time # This is the template for a decorator def decorator(func): @wraps(func) def wrapper_decorator(*args, kwargs): # do something before function here value = func(*args, kwargs) # do something after function here return value return wrapper_decorator def time_th...
Using print() in (micro)python. I made this video for myself but feel free to watch it.
มุมมอง 10321 วันที่ผ่านมา
Here's my code so you don't have to watch the video. # \ Escape Sequences # Newline # \t Tab # \a ASCII Bell # \ooo Character with octal value "ooo" # \xhh Character with hex value "hh" # \\ Backslash # \" Double quote # \' Single quote # \b Backspace # \r Carriage return # Can also use end, sep and flush a = 'apple' b = 'pear' print( a, '\t', b) print( a, '\t', b, end='') print( a, b, sep=' an...
My final video for Paul McWhorter's Pico W Lesson 100 that actually works properly.
มุมมอง 77หลายเดือนก่อน
I've found where I was going wrong. Hurrah!!! Previous attempt that demonstrates it better: th-cam.com/video/AoWLLk6wgaA/w-d-xo.htmlsi=9_1jVl0gE-_oqPkQ Paul's lesson 100: th-cam.com/video/rJ2nPpYsgZo/w-d-xo.htmlsi=V2SDmJqx4ez9w0H_
My video for Paul McWhorter's Pico W Lesson 100 - Using a PIO Servo properly with more functionality
มุมมอง 56หลายเดือนก่อน
This video highlights a potential problem when using state machines in a class. Return to Paul's lesson 100: th-cam.com/video/rJ2nPpYsgZo/w-d-xo.htmlsi=AwtFs31SU0akCNzo
My video for Paul McWhorter's Pico W Lesson 99 - Moving servos
มุมมอง 67หลายเดือนก่อน
This video should cover lessons 100 - 102 as well. I'm moving several servos independently of each other. Return to Paul's lesson 99: th-cam.com/video/F8_SaNCi9FY/w-d-xo.htmlsi=pggabPyyziIAFXfC
My video for Paul McWhorter's Pico W Lesson 98 - Sweep a servo arm using PIO (non-blocking)
มุมมอง 63หลายเดือนก่อน
This program uses a generator. I LOVE GENERATORS!! My lesson 55 which explains a bit about generators: th-cam.com/video/LCg1f5p6fI0/w-d-xo.htmlsi=2eTKALkOguByRLhf Return to Paul's lesson 99: th-cam.com/video/F8_SaNCi9FY/w-d-xo.htmlsi=TmFxMl55vkh4T5It
My video for Paul McWhorter's Pico W Lesson 97- Control a servo using PIO
มุมมอง 60หลายเดือนก่อน
Return to Paul' lesson 98: th-cam.com/video/eEBUl07-ub4/w-d-xo.htmlsi=mEBYjvZgHXOMFqWu
My video for Paul McWhorter's Arduino R4 Lesson 44 - playing music using a passive buzzer.
มุมมอง 412 หลายเดือนก่อน
I can't remember where I found the music so thanks and apologies to whoever created it. Return to Paul's lesson 44: th-cam.com/video/lK-tmgaWrLg/w-d-xo.htmlsi=31N3aDqYfggPMawa
My alternative video for Paul McWhorter's Pico W Lesson 95
มุมมอง 712 หลายเดือนก่อน
This video shows an alternative way to place buttons on a breadboard and also how to make switching between an Arduino and a Pico a little easier. Return to Paul's lesson 95: th-cam.com/video/KuiXFAgWpxg/w-d-xo.htmlsi=lD6C4BC3uSX4ArxC
My video for Paul McWhorter's Arduino R4 Lesson 42 - Using an active buzzer
มุมมอง 562 หลายเดือนก่อน
Producing an SOS message in morse code using an active buzzer. Elektor TV discussion about the new Arduino Uno R4: th-cam.com/users/livevrZ_aJnFd-Q?si=eXNJwyPsI-eycKSP My homework for lesson 2 using an LED: th-cam.com/video/PFt0DDX04b0/w-d-xo.htmlsi=ELAMjegSWO1dHvq1 Return to Paul's lesson 42: th-cam.com/video/xRMRi_La48o/w-d-xo.htmlsi=71PBnyQhrvo6QSpW
Heart button update. IT WORKS!!!
มุมมอง 402 หลายเดือนก่อน
This video is a follow up to Lesson 40 when I showed how to use the heart shaped blob of solder on the back of board to control an LED by touching it with a wire connected to ground. After watching a video by Delta_G Robotics and using his LoveButton.h library, I can now use the heart as a touch sensor. Thanks, Delta_G Robotics (David Caldwell). You're a superhero!! Return to Pauls's lesson 41:...
My video for Paul McWhorter's Arduino R4 Lesson 40 and also using the heart on the back of the board
มุมมอง 953 หลายเดือนก่อน
The first program controls the brightness of an LED with a potentiometer using functions and no global variables. The second part of the video is about the little heart on the back of an Arduino Uno R4 Wifi and Minima. Return to Paul's Lesson 40: th-cam.com/video/SeAT_sELVdw/w-d-xo.htmlsi=Xben_fieNy_uBna_
My video for Paul McWhorter's Arduino Uno R4 Lessons 31, 33, 35 & 36
มุมมอง 693 หลายเดือนก่อน
Return to Paul's lesson 38: th-cam.com/video/SeAT_sELVdw/w-d-xo.htmlsi=1I9qiLD-erNixmF0
My follow-up to Paul McWhorter's Pico W Lesson 91 Chat - How many PIO commands are there?
มุมมอง 903 หลายเดือนก่อน
Why does nobody believe me? Return to Paul's lesson 91: th-cam.com/video/-Wgo-qkAxBQ/w-d-xo.htmlsi=QundYqtnY6eaQ3OA
My video inspired by Paul McWhorter's Pico W Lesson 90 - Doing simple arithmetic using PIO.
มุมมอง 633 หลายเดือนก่อน
My video inspired by Paul McWhorter's Pico W Lesson 90 - Doing simple arithmetic using PIO.
My video for Paul McWhorter's Pico W Lesson 90 - Creating a binary counter that counts up.
มุมมอง 683 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 90 - Creating a binary counter that counts up.
This is my solution to Paul McWhorter's PIO Challenge on the Pico W PIO Challenge
มุมมอง 1553 หลายเดือนก่อน
This is my solution to Paul McWhorter's PIO Challenge on the Pico W PIO Challenge
My video for Paul McWhorter's Pico W Lesson 87 - Starting out with PIO
มุมมอง 714 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 87 - Starting out with PIO
My video for Paul McWhorter's Pico W Lessons 83 & 84 - Debouncing buttons
มุมมอง 924 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lessons 83 & 84 - Debouncing buttons
My video for Paul McWhorter's Arduino R4 Lesson 29 - Create a Pong game
มุมมอง 395 หลายเดือนก่อน
My video for Paul McWhorter's Arduino R4 Lesson 29 - Create a Pong game
My video for Paul McWhorter's Pico W Lesson 81a - Binary counter using a variable number of LEDS
มุมมอง 405 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 81a - Binary counter using a variable number of LEDS
My (personal) video to remind me how I did Paul McW's Pico W Lesson 80. You're welcome to watch!!
มุมมอง 1835 หลายเดือนก่อน
My (personal) video to remind me how I did Paul McW's Pico W Lesson 80. You're welcome to watch!!
My video for Paul McWhorter's Pico W Lesson 81 - Create a binary counter using 4 LEDs and timers
มุมมอง 3715 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 81 - Create a binary counter using 4 LEDs and timers
My 3rd (and final) video for Paul McWhorter's Pico W Lesson 80 - Using timers with 3 LEDs
มุมมอง 3685 หลายเดือนก่อน
My 3rd (and final) video for Paul McWhorter's Pico W Lesson 80 - Using timers with 3 LEDs
My second video for Paul McWhorter's Pico W Lesson 80 - Using Timers & LEDs
มุมมอง 505 หลายเดือนก่อน
My second video for Paul McWhorter's Pico W Lesson 80 - Using Timers & LEDs
My video for Paul McWhorter's Pico W Lesson 80 - using timers with LEDs
มุมมอง 675 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 80 - using timers with LEDs
(Terrible) video of how to get a Pico W connected to a Freenove RPi Projects Board.
มุมมอง 935 หลายเดือนก่อน
(Terrible) video of how to get a Pico W connected to a Freenove RPi Projects Board.
My video for Paul McWhorter's Arduino R4 Lessons 24, 25 & 27 - Using buttons and LEDs
มุมมอง 706 หลายเดือนก่อน
My video for Paul McWhorter's Arduino R4 Lessons 24, 25 & 27 - Using buttons and LEDs
My video for Paul McWhorter's Pico W Lesson 77 - Using an IR remote control and neopixels
มุมมอง 416 หลายเดือนก่อน
My video for Paul McWhorter's Pico W Lesson 77 - Using an IR remote control and neopixels

ความคิดเห็น

  • @larryplatzek9017
    @larryplatzek9017 3 วันที่ผ่านมา

    interesting what is mydecorators?

    • @charlotteswift
      @charlotteswift 2 วันที่ผ่านมา

      @larryplatzek9017 Hi Larry. mydecorators.py is the library file of decorators that I've created. I've made a (rather long) video all about decorators which should explain everything if you're interested. Here's the link th-cam.com/video/gGDxZr7X_JY/w-d-xo.html

    • @charlotteswift
      @charlotteswift 2 วันที่ผ่านมา

      @larryplatzek9017 Hi Larry I replied to this comment and included a link. Sometimes this means that you-know-who will delete my comment even if I'm commenting on one of my own videos on my own channel. This is very annoying!!! If you get a moment, let me know whether you got my previous comment and, if not, I'll just tell you the title of the video.

    • @larryplatzek9017
      @larryplatzek9017 2 วันที่ผ่านมา

      @@charlotteswift yes i see both emails, but if I hit reply it brings up the video. both of these videos have good information Thank you!

    • @charlotteswift
      @charlotteswift 2 วันที่ผ่านมา

      @larryplatzek9017 Hurrah!!

  • @keithlohmeyer
    @keithlohmeyer 3 วันที่ผ่านมา

    Interesting. Always learn something in your vids. But I just like to blink LEDs😸

    • @charlotteswift
      @charlotteswift 3 วันที่ผ่านมา

      @keithlohmeyer No, Keith. What you mean is that you just like to wear neopixels😁Thanks for watching

    • @keithlohmeyer
      @keithlohmeyer 3 วันที่ผ่านมา

      @@charlotteswift So true. I ran into a problem with my 60 pixel string using the pio code. Both mine and Paul's code glitched on the 60 string. It seems iterating through a list of pix colors is too slow for a long string. I think the pio gets caught up and the break signals to the string that we are done and starts over when data resumes. I have reworked the code using the array module. The array stores the data in the shifted format *(g<<16) + (r<<8) + b* and you can *sm.put* the whole array at once. I will have a vid describing the problem soon.

    • @charlotteswift
      @charlotteswift 3 วันที่ผ่านมา

      @keithlohmeyer I won't take a look until I try it myself otherwise it would be cheating. Step one: Locate neopixel string🙃

    • @wendygrant2735
      @wendygrant2735 3 วันที่ผ่านมา

      @@charlotteswift Locate neopixel string? Found it! I wear it as a boa.🐍

    • @charlotteswift
      @charlotteswift 3 วันที่ผ่านมา

      @wendygrant2735 All the time? Or just on special occasions?

  • @leeg.1402
    @leeg.1402 10 วันที่ผ่านมา

    Nice video. I’ll admit I don’t understand all of it and will have to watch your video again (and again). But, it keeps the brain juices flowing, so that’s good. Thanks for posting.

  • @keithlohmeyer
    @keithlohmeyer 10 วันที่ผ่านมา

    Pure gold! Thanks.

    • @charlotteswift
      @charlotteswift 10 วันที่ผ่านมา

      @keithlohmeyer Thanks, Keith. I thought you would like it but you're probably the only one though😿 Maybe I should have said "I'm making this video for Keith and myself"😁

  • @bobingridshaw5361
    @bobingridshaw5361 20 วันที่ผ่านมา

    Thank you for responding to my question! I am studying your video now and will try to respond after I have digested it. Bob Shaw.

    • @charlotteswift
      @charlotteswift 20 วันที่ผ่านมา

      @bobingridshaw5361 Hi Bob. The code that deals with deciding which state machine(s) can be used is in my previous video for lesson 100 from about 11 minutes. I hope it makes sense.

  • @johnganci933
    @johnganci933 21 วันที่ผ่านมา

    Nice video. Saw some "old friends" and met some new ones. Noticed that you are using an old MicroPython - 1.20 from April 2023. The latest is 1.24 from November 2024. You might try your examples that failed with it.

    • @charlotteswift
      @charlotteswift 20 วันที่ผ่านมา

      @johnganci933 Old? You call that old? One of my favourite sweatshirts is one that I bought in Cannes in 1993. It was half price because it was promoting a 1992 film (Nikita). I never watched the film but I still love the sweatshirt👍👌Thanks for alerting me to my out-of-datedness. Maybe I ought to move on fron Python 3.10 too.

    • @johnganci933
      @johnganci933 20 วันที่ผ่านมา

      @@charlotteswift I meant old in computer terms. What you buy today is obsolete tomorrow.😀

  • @leeg.1402
    @leeg.1402 24 วันที่ผ่านมา

    Thanks for the nice refresher! Hope you and your family had a "jolly good" holiday!

    • @charlotteswift
      @charlotteswift 23 วันที่ผ่านมา

      @leeg.1402 Thanks, Lee. I hadn't realised until I made this video how many inconsistencies there are between python and micropython. Do Americans say 'jolly good'? Maybe nobody says it apart from me😿

  • @wendygrant2735
    @wendygrant2735 24 วันที่ผ่านมา

    Thank you for the video again. All my best wishes for you and your family.

    • @charlotteswift
      @charlotteswift 24 วันที่ผ่านมา

      @wendygrant2735 Thanks, Wendy. I hope you didn't watch it all - that would be 40 minutes of your life that you'll never get back!! I hope you had a good Christmas and you're keeping warm. It's jolly cold here.

  • @peterkarlsson7801
    @peterkarlsson7801 24 วันที่ผ่านมา

    Thanks for sharing a lot of useful information!

    • @charlotteswift
      @charlotteswift 24 วันที่ผ่านมา

      @peterkarlsson7801 It's surprising what you can find on old scraps of paper😁

  • @jameslewellen150
    @jameslewellen150 25 วันที่ผ่านมา

    Good video. That is very good coverage of the python print functions. Nicely done

    • @charlotteswift
      @charlotteswift 25 วันที่ผ่านมา

      @jameslewellen150 Thanks, James. The video is horrendously long but I wanted to put in everything as a reference for myself. Probably most people will stop watching way before the interesting (imo) bit😿

  • @wetheproz5422
    @wetheproz5422 26 วันที่ผ่านมา

    I love you Charlotte

    • @charlotteswift
      @charlotteswift 25 วันที่ผ่านมา

      @wetheproz5422 That's very kind of you. Glad you liked it.

  • @leeg.1402
    @leeg.1402 หลายเดือนก่อน

    Thanks Charlotte!! I’m learning so many new “tricks” (i.e. ways of doing things) from you!! Hope you have a nice holiday season.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @leeg.1402 Ah, I have an ulterior motive. I'm hoping that you'll send me the blueprints when you design the robot that can do housework. Have a good Christmas and don't eat too much turkey.

  • @peterkarlsson7801
    @peterkarlsson7801 หลายเดือนก่อน

    In my solution to the homework, I have the PIO program outside the class. Just so I can put as many nop()'s as I want...

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @peterkarlsson7801 Yes, I realised that having the asm program inside the class was what was causing the problem. I've made another short video explaining why. NOOOO to nop() !!

  • @bigbogeyface
    @bigbogeyface หลายเดือนก่อน

    Wow!!! 😮 That really is super cool 😎 👌

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @bigbogeyface Thanks, Mr Burger. That's about as good as I can be bothered to make it unless I can manage to put the for loops within the assembler bit. 🤔

    • @bigbogeyface
      @bigbogeyface หลายเดือนก่อน

      @charlotteswift You're very welcome 😊 🙏 Hmmm 🤔 For loops in the state machine 🤔

  • @charlotteswift
    @charlotteswift หลายเดือนก่อน

    I am a very stupid woman but I've fixed the problem. I'll release another (thankfully short) video soon so don't bother to watch this one.

  • @bigbogeyface
    @bigbogeyface หลายเดือนก่อน

    Most excellent 👌

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @bigbogeyface Thanks, Mr Burger. I've worked out what the problem was. Everything is working fine now. Hurrah!!!

  • @paulmcwhorter
    @paulmcwhorter หลายเดือนก่อน

    Interesting. My thoughts were similar to Keith's.

  • @keithlohmeyer
    @keithlohmeyer หลายเดือนก่อน

    You can probably use a class method. A class method is a def within a class but it is not bound to an instance and does not have a self attribute. You would just call the method with your_class.your_class_method() In your case move the def servo_pio() code out of the init and put it just under the class declaration as a stand alone (class) method I believe the reason for your error as that each instance creates a separate list of instructions to use whereas the class method is just one set of instructions pointed to by different instance methods.

    • @keithlohmeyer
      @keithlohmeyer หลายเดือนก่อน

      After re-reading this I may be describing a static method rather than a class method. I always get them mixed up.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer @paulmcwhorter Thanks for your thoughts. It wasn't until I looked at Arnold's very simple solution that I realised that I had put the asm_pio inside the PIO class which was very stupid. 🙃🙃 I just grabbed everything to do with PIO etc and stuck it in the class. Must do better next time!!

  • @jyvben1520
    @jyvben1520 หลายเดือนก่อน

    semi colon divides commands, so you can put many commands on 1 line from machine import Pin ; led=Pin('LED') ; led.on() ; x = 5; z = 0 ; print(x, z) works but makes it a bit more difficult to read, other way to declare x and z x, z = 5, 0 you can put comments (almost) anywhere @rp2.asm_pio(set_init=rp2.PIO.OUT_LOW, # test comment out_shiftdir=rp2.PIO.SHIFT_RIGHT) like inside a list ( or dictionary) x = [ [1,2,3] # first tuple , [2,3,4] # second tuple ] # end of list x to block multiple lines use the triple quote or triple double quote, but use #""" at the end, to unblock just put a # before the starting """ """ blocked .... #""" # end of block with 1 # added you unblock #""" unblocked .... #""" # end of block Thonny editor might not show it correctly (to force it, add a space inside the triple + del it) but the compiler will work as expected. do you use #TODO in your code, insert #TODO anywhere you still need to enhance/develop/review code, then in Thonny you can choose View/TODO, to get a list of todo .... and #TODO is a comment so you can type any text behind it to remind you of .... click on the line in the TODO window to jump to that line in your code

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @jyvben1520 I agree with what you've said. I just mentioned being able to put a semi colon at the end of a line in micropython because I get fed up with people whining about the syntax being different in micopython and C++. I don't tend to use a semi colon to join lines because, yes, it does make it more difficult to read. Personally, I don't use #TODO because I find it quicker to type three dots and they're easy to see. (I am a VERY lazy typist). Even if using semi colons like I said is a stupid idea (I did say in the video that it was probably a stupid idea), I'm quite pleased with my idea of bending the button leg😁 On the subject of being difficult to read, when I opened the email containing your comment, TH-cam/Gmail had scrunched it all together with no new lines or tabs. Aargh!!!! Thanks for watching/commenting.

  • @keithlohmeyer
    @keithlohmeyer หลายเดือนก่อน

    Charlotte you seem to be the only person that has posted independently operating servos. All the other vids show them with just mirrored sweeping. To be honest that seems to be what Paul was looking for. Your generator code takes it to the next level. Thanks for showing how the generator works. I wonder how Paul will achieve independent operation. Or he may not go there at all.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer I always have to do things differently😁 Paul did only ask us to make the servos move like old fashioned windscreen wipers which I suppose is what everyone did. [If my wipers moved like my servos, I would buy another car]. The lessons are moving soo slowly! One lesson to create a class then another lesson to make it into a library. How hard is it to move the class to another file, save it to 'lib' on the pico and put in an import statement? Paul will have to implement independent operation otherwise the whole exercise will have been a waste of time. And why would anyone want a program that can't do anything other than move a servo? I don't think timers or interrupts would work with PIO and I can't see him getting into asyncio. So I think he'll have to create the equivalent of a for loop manually, use a generator or do everything within the state machine. This would be tricky but possible, I think. I was contemplating the matter in the bath last night🛀

  • @keithlohmeyer
    @keithlohmeyer หลายเดือนก่อน

    Interesting... Very interesting. My take on the docs was that the 4 state machines shared the same 32 instructions but you are saying they get divided between the 4 sm. Time for some investigation.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer That would seem very strange to me but maybe you're right. I have no 'take on the docs' for obvious reasons😁I hope you're wrong because otherwise this video is total nonsense🙃 Did you see my pinned comment about my mistake? Note to self: Never 'tidy up' code without testing it afterwards! Thanks for watching.

    • @keithlohmeyer
      @keithlohmeyer หลายเดือนก่อน

      @@charlotteswift Busy with grandkids this weekend but I have some ideas on how to test it. I will let you know what I find. You could add a dozen NOP to your code and see if it still works.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      I DON’T USE NOP!!!

    • @keithlohmeyer
      @keithlohmeyer หลายเดือนก่อน

      @@charlotteswift Well ok then 😁

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer No need to test it. I combined my PIO challenge program using 20 instructions on state machine 1 with my lesson 98 servo program using 7 instructions on state machine 0 and the servo chugs away happily while I press the up and down buttons to change the binary display. Thanks goodness I'm using the little board that Brian MADE me buy. I only had to add another 6 wires to the rat's nest. On a normal breadboard setup, it would have been another 12 wires and 4 resistors. I rather like having the servo doing its thing and being able to turn the lights on and off. I might leave it running on my desk permanently👍😁There again, Frankie the cat, would probably attack it🐈‍⬛🐈‍⬛

  • @paulmcwhorter
    @paulmcwhorter หลายเดือนก่อน

    Nice work.

  • @charlotteswift
    @charlotteswift หลายเดือนก่อน

    RATS!!!!! After watching Paul's lesson 100, I have to recalculate how many instructions are in each PIO block. I feel another video coming. ERROR!! I made a mistake when tidying up my code. If there is room in the first PIO block but all state machines (0-3) have been used, it won't bother to look in the second PIO block. Line 26 in the ServoPIO class: elif sum(state_machine_usage[4:8], self._num_instructions) <= 32: should be: if self._sm_num == -1 and sum(state_machine_usage[4:8], self._num_instructions) <= 32: AND the else should be: if self._sm_num == -1: Sorry about that🙃

  • @quaternion-pi
    @quaternion-pi หลายเดือนก่อน

    OMG, love the clever generator solution. Maybe unrealistic, but would like to learn how to preload data in pico memory and use the dma feature of the state machine - have the state machine read the data directly from preloaded memory. Since I just subscribed, does that make me a Swiftie? (sorry, rather philistine of me). Keep up the innovative solutions.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @quaternion-pi Thanks, Carter. Using PIO is quite strange. It's complete overkill for many things (servos included) and far, far too difficult for a mere mortal like me when trying to do complicated things. Probably the best application of it is for controlling Neopixels but then you can just use a library. Paul seems to be enjoying it though. I cannot imagine anyone wanting to be a Swiftie!!

  • @johnganci933
    @johnganci933 หลายเดือนก่อน

    An excellent video. I did not know about generator functions. Now I do. Using the genertor function does yield a much better solution.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @johnganci933 Thanks, John. I suppose the grown-up way would be to use asyncio but it makes my head hurt🤕

  • @keithlohmeyer
    @keithlohmeyer หลายเดือนก่อน

    Nice! I like generator.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer Thanks, Keith. It was probably a waste of time because I'm sure that it would be much better to do everything in the state machine but I feel that I need another register (or two) or a better brain🙃

    • @keithlohmeyer
      @keithlohmeyer หลายเดือนก่อน

      @@charlotteswift I really think all that math would be too much for the state machine.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @keithlohmeyer I don't know about the state machine but I think it would be too much for me🙃I need to look into storing several things in the osr/isr and taking them out from each end. Probably it isn't possible😿

  • @leeg.1402
    @leeg.1402 หลายเดือนก่อน

    Nice Job!! I didn’t really look at or study your code (didn't want to cheat! 😁). I confess I’ve fallen behind in completing the lessons (again). Hopefully will get caught up soon. Enjoy the Holidays!!

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @leeg.1402 Thanks, Lee. I don't know how many people appreciate the value of generator functions. Since making this video, I've looked at other solutions and everyone has done it in the 'lame' blocking way. I hope that I haven't made any enemies👺btw I'm going to look at Paul's latest Arduino lesson (before he issued the warning). I believe that the Freenove projects board has all the protection built in. I'll warn you if mine blows up.

    • @leeg.1402
      @leeg.1402 หลายเดือนก่อน

      @@charlotteswift Generator functions were covered in the “Fluent Python” book (and your earlier post), so I know a “little” bit about them. It’s nice that you used one, so we can see a practical application of them. If other people don’t want to use them, that’s their loss. I’ve been concentrating on the Pico lately, rather than the Arduino. I listen to Paul’s Arduino lectures just to pick up anything new he has to offer. Most of it he has gone over (several times) in earlier lessons. My New Year’s project is to build a robot car (from scratch - not a kit), hopefully putting everything I’ve learned in these lessons to use. Will probably need a fire extinguisher for all the smoke I’ll be generating! 😊

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @leeg.1402 I had forgotten that you had 'Fluent Python' but, more importantly, I had forgotten that I had 'Fluent Python' 🙃🙃I'm not that interested in robots unless they could do the housework. HAVE FUN!!

  • @johnganci933
    @johnganci933 หลายเดือนก่อน

    Nice solution. I did read your code and did understand it. Brain did not hurt afterwards. One comment. Look at line 37 of your source, then line 43. (That's the professor in me coming out that I can't keep contained.)

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @johnganci933 Hi John I replied to your comment but it does not show up in the YT stats. It a pretty poor show when your own comment gets blocked from your own channel. I'll delete it and try again. That didn't seem to work so I'll try commenting via the video instead on via studio. I said .... ah, yes, that was a bit of a howler! I did wonder at the time why it didn't seem to do anything. In my defence, I was doing it in a rush just before the lesson because I didn't want people to think that I had just copied Paul's solution. I changed my method halfway through and forgot to change the first bit. MUST TRY HARDER!! B-.

  • @charlotteswift
    @charlotteswift หลายเดือนก่อน

    I forgot to say in the video, the reason why I set the pins to 1 or 0 within the loops is to make the timing more exact. Can you have 'more exact'? Things are either exact or they aren't. Maybe I should have said 'less inexact'.🙃🙃🙃🙃🙃🙃🙃🙃

  • @quaternion-pi
    @quaternion-pi หลายเดือนก่อน

    Very interesting solution. Charlotte, I knew you would come up with something out of the ordinary. Interesting commentary on "cheating" without understanding. Since there are not many of us contributing solutions, one wonders which of us contributors might be the guilty uncomprehending googler(s) 😀. Thanks for adding value to the tutorials - always something interesting in your solutions and comments.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @quaternion-pi Thanks, Carter. It definitely isn't you! After seeing your (and other solutions), it has dawned on me why sideset would be a good idea. I will be adding PIO to my home grown servo class (if I can ever find it again🙃) and then it would be good to get the number of instructions down to 8 or less so that 4 instances can fit on each PIO block. One obvious use for servos is to have 3 (yaw, pitch and roll). I could cut my 12 instructions down by using sideset (10 instructions) and maybe not setting the initial value of the pulse width (8 instructions). I doubt whether it achieved anything anyway. Your idea of using exec instead of having any instructions before wrap_target (6 instructions) would also help but then I would be wasting 2!😿 Probably the days of uncomprehending googler(s) have passed because the lessons are getting more complicated. I look at other people's solutions and when I see a solution that isn't quite right and then, the next day, there's another one that has the same fault, I smell a rat🐀

    • @quaternion-pi
      @quaternion-pi หลายเดือนก่อน

      @@charlotteswift This PIO is kind of addicting, if not very practical. A work colleague chastises me for "playing with LEDs", as he spends hours on Wordle. Interestingly (at least to me) is that the WSJ (Wall Street Journal for you youngsters) had a recent article on "Googling is for old people. That's a problem for Google". I haven't really got much out of TikTok to help me with state machines. However, StackOverflow and Reddit - not bad.

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @quaternion-pi Unfortunately, despite the fact that I sound like a 13 year old on my videos, I am no youngster😿

  • @paulmcwhorter
    @paulmcwhorter หลายเดือนก่อน

    Well done.

  • @bigbogeyface
    @bigbogeyface หลายเดือนก่อน

    You released this video at the most perfect time 😃👍

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @bigbogeyface I had to do it before Paul's lesson otherwise everyone would have thought that I had cheated!

    • @wendygrant2735
      @wendygrant2735 หลายเดือนก่อน

      @@charlotteswift No no! Charlotte is no cheater. Never!⛔

    • @bigbogeyface
      @bigbogeyface หลายเดือนก่อน

      @@wendygrant2735 Hey Wendy 👋 How the devil are you? 👋😃

    • @charlotteswift
      @charlotteswift หลายเดือนก่อน

      @wendygrant2735 You can quite often tell when someone's googled something and copied it without understanding it. 😁We've probably got a couple of months of PIO ahead of us and, by the end, I'll DEFINITELY be cheating!!

    • @keithlohmeyer
      @keithlohmeyer หลายเดือนก่อน

      @@charlotteswift You have to remember Paul is only a step ahead of the rest of us on this. I commend him for putting out these videos. All his Python related vids have made me learn new stuff. The PIO is the latest. Pauls gift is to break down the lessons into chunks. With the current servo project I believe he will end up with something very close to the PWM class example in the examples linked to on the Micropython PIO docs page. I have stopped posting vids or putting much thought into this project as I believe the hardware PWM on the Pico already does the job without blocking and with less coding. Thanks for the video.

  • @paulmcwhorter
    @paulmcwhorter 2 หลายเดือนก่อน

    Nice work!

  • @bigbogeyface
    @bigbogeyface 2 หลายเดือนก่อน

    I thought you said it was short 🤨 There's two minutes of my life I'll never get back 😏 I thought maybe you would have done "Just looking" by the Stereophonics or something 🤔 Anyhow, nice work, very neat 👏 👌

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @bigbogeyface Thanks, Mr Burger. Maybe I should have said 'shorter than usual'. Rat in my kitchen was too hard🐀

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @bigbogeyface I know that you don't know anything about politics but have you heard about the petition to call a general election because Starmer et al are li*rs, thie*es and totally us*less. I've signed it and so should everyone else! It's got over 2.6 million signatures since Thursday.

  • @charlotteswift
    @charlotteswift 2 หลายเดือนก่อน

    The buzzer volume isn't very loud. It was much louder (too loud) when I used my Freenove Projects board with an R3 but it annoyed Peter and scared Frankie. btw in case you didn't recognise it, it's the music from Game of Thrones.

  • @johnganci933
    @johnganci933 2 หลายเดือนก่อน

    Nice idea about button placement. Where are the kittens, ducklings and puppies? 🙂 One of these days our cat will sneak into one of my videos.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @johnganci933 Thanks, John. TH-cam has obviously decided that I post too many boring videos and comments. Any comments with links to my videos get deleted almost instantaneously and most of the others suffer the same fate unless I mention cute animals. When YT gets wise to this, I'm going to have to call everything 'The best chocolate cake recipe in the world, ever' or 'How to knit an umbrella' 😸I look forward to seeing your cat - much more interesting than PIO. Paul's made 16 lessons about it and he's not done yet😿He probably did them all in a weekend but 4 months of the same stuff is driving me to chew my left arm off! Sorry about the lack of kittens🐈🐈🐈, ducklings🦆🦆🦆 and puppies🐕🐕🐕

  • @jannatulnayeem7289
    @jannatulnayeem7289 2 หลายเดือนก่อน

    Thank you so much for such amazing video. You saved lot of time for me. Thank you again.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @jannatulnayeem7289 Thanks. That's very kind of you. Whenever I get a comment on one of my old videos, I'm dreading that someone is going to ask a question about it. My memory is so bad that I can't remember and I have to watch my own video to remind myself how to do things🙃

  • @wendygrant2735
    @wendygrant2735 2 หลายเดือนก่อน

    Hey Charlotte, I don't remember telling you I died.😁 I always watch your videos.😉

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @wendygrant2735 You said that you were quite poorly and then you went quiet. l’m a worrier - the kind of person who keeps poking their grandmother when she’s asleep just to make sure that she hasn’t snuffed it. Luckily, I don’t have a grandmother! Thanks for watching (and for not snuffing it). I should have put in some jokey emojis but I can’t find them on my iPad.

    • @wendygrant2735
      @wendygrant2735 2 หลายเดือนก่อน

      @@charlotteswift I can be your grandma if you want me to.🧓🧓🧓

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @wendygrant2735 That's very kind of you but I'm more of a cat person🐈‍⬛🐈‍⬛🐈‍⬛

    • @wendygrant2735
      @wendygrant2735 2 หลายเดือนก่อน

      @@charlotteswift Cats are not allowed by Mr McWorther. You walk a very thin line there.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @wendygrant2735 My channel, my rules😁

  • @VeryUsMumblings
    @VeryUsMumblings 2 หลายเดือนก่อน

    Warning! Turn down Volume at 4:30 ! 😄cool video! 👍

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @VeryUsMumblings Sorry about that🙇‍♀️

  • @paulmcwhorter
    @paulmcwhorter 2 หลายเดือนก่อน

    Well done

  • @bigbogeyface
    @bigbogeyface 2 หลายเดือนก่อน

    That's amazing, who knew the heart ❤️ touch 👈 button even existed 🤯 You have blown my tiny little mind 🤯 now I gotta mop up all these bits of brain off my floor 😏

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @bigbogeyface Thanks, Mr Burger, but just imagine how good it would be with a burger-shaped blob of solder🍔

    • @bigbogeyface
      @bigbogeyface 2 หลายเดือนก่อน

      @charlotteswift 😲🤯 Holy Burgerino Batman 😃 🤤 That wound be super dooper awesome 🍔 😋👌

  • @lorisrobots
    @lorisrobots 2 หลายเดือนก่อน

    Very cool - thanks for sharing. I was planning to use some homemade capacitive touch sensors for a project. Will be interesting to compare.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @lorisrobots Thanks, Lori. I don't often use other people's work but I made an exception for this because it was too hard🙃I don't know much (anything) about capacitors. Paul doesn't seem interested.

    • @lorisrobots
      @lorisrobots 2 หลายเดือนก่อน

      @@charlotteswift I think it is fine to learn from other folks and leverage their work. Just need to provide attribution IMO. I am hoping Paul will do a circuits type course one day. But that probably won't provide the views he needs for his patreon support. I plan to work through "Make: Electronics" by Charles Platt to improve my understanding of basic electronics and circuits.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @lorisrobots Is that a book? You don't need to answer that. I've just realised that I have Make: Easy Electronics, Make: Electronics & Make: More Electronics, all by Charles Platt. So you recommend him?

  • @keithlohmeyer
    @keithlohmeyer 2 หลายเดือนก่อน

    Nice find. Thanks for the video.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @keithlohmeyer Thanks, Keith. It's not exactly very useful to you as you don't have an R4

  • @keithlohmeyer
    @keithlohmeyer 2 หลายเดือนก่อน

    Look at you searching like a hunter gatherer. Welcome to the dark side.

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @keithlohmeyer Strangely, my reply disappeared off my own video😿The YT peeps must REALLY hate me. I said that I won't make a habit of it.

  • @VeryUsMumblings
    @VeryUsMumblings 2 หลายเดือนก่อน

    I got the touch sensor working. (not the heart button) on pin 9. I think you were right. It needs a ceramic capacitor abouot 10 nano farads. I happened to have one. I was thinking about posting a video on it. 😄

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @VeryUsMumblings I've been rummaging around and I found a 330nF ceramic capacitor in my Monk's Makes Starter Kit for the Raspberry Pi (the very first kit that I ever bought in a big fairly empty box😿). The legs were very short so I had to put it on my breadboard with leads going to grd and pin 7 but ......... IT WORKS!!!!

    • @VeryUsMumblings
      @VeryUsMumblings 2 หลายเดือนก่อน

      @@charlotteswift Congratulations! 👍

  • @VeryUsMumblings
    @VeryUsMumblings 2 หลายเดือนก่อน

    We don't need no stinkin' variables! 😄 I did a touch sensor with an ESP32 and it's much easier. The R4 wifi board has an esp chip on it. I'll have to check out that video, but this one was pretty good, too! 👍

    • @charlotteswift
      @charlotteswift 2 หลายเดือนก่อน

      @VeryUsMumblings Agreed!! Variables and documentation are for wimps!! When I'm feeling REALLY lazy (which is most of the time), I just convert by dividing by 4 but I've just found out about analogReadResolution so I didn't need the conversion bit either. On the down side, 'analogReadResolution(8)' takes longer to type than '/ 4'. Thanks for watching (and commenting)👍

  • @peterkarlsson7801
    @peterkarlsson7801 3 หลายเดือนก่อน

    EXCELLENT! In your first program, I think you should use local variables in the loop function, instead of doing all function calls in one line. Your second program shows how useful direct port/register access is. :-) I have an idea how to make an easy touch sensor, but I need the time to play with it.

    • @charlotteswift
      @charlotteswift 3 หลายเดือนก่อน

      @peterkarlsson7801 Ah, yes, I know that it would have been better to have used some variables but I wanted to see whether I could do it without any at all. I did say that 'This is how you COULD do it, not how you SHOULD do it'😁 Normally I would do it all in one line without using functions but the homework was all about using functions. In fact I already had written the program which consisted of 2 variables, 1 line in setup and 1 line in loop. I hate typing!!! You ought to look at Delta_G Robotics's stuff. Like you, he actually understands the documentation. Thanks for watching (and commenting).

  • @paulmcwhorter
    @paulmcwhorter 3 หลายเดือนก่อน

    Interesting. Thanks.

  • @leeg.1402
    @leeg.1402 3 หลายเดือนก่อน

    Nice video. The touch sensor is intriguing; I’ll have to put checking that out on my never-ending “to do” list. Thanks for posting.

    • @charlotteswift
      @charlotteswift 3 หลายเดือนก่อน

      @leeg.1402 Thanks, Lee. It would be really good to get it working with a finger. I don't know whether I've got any touch sensors included in various kit and I don't really understand the ins and outs of capacitors and what the differences between the ceramic ones and the electrolytic ones. The trouble is that the R4 hasn't been around long enough for other people to have done all the hard work for us😁 And Keith doesn't have one😿👎

  • @johnganci933
    @johnganci933 3 หลายเดือนก่อน

    I posted a comment that contains a link to my solution in Paul's "Rumble in the Jungle" livestream earlier today, which "allowed" me to watch your and quaternion's solutions. Both are nicely done. I took a different appropach -- two state machines, each handling one of the two buttons. My solution used 29 PIO instructions, so a lot longer than yours. All of our solutions do the "up one" and "down one" code pretty much the same way. Nice job on your part.

    • @charlotteswift
      @charlotteswift 3 หลายเดือนก่อน

      @johnganci933 I just watched your video. It's a lot more grown up than mine😁 Thanks for watching.