The Raspberry Pi Thread [6]


  1. Posts : 305
    Win 10 and 11
       #1561

    alphanumeric said:
    Found a glitch or two in my code while playing around with different button combo's. Also did some cleanup of repeated code that didn't need to be. Python and Micro Python is so unforgiving of a misplaced indent. Miss a tab and weird things happen, or what you wanted to happen doesn't.
    Visual Studio Code, my friend. It checks your formatting for you in most cases. I would be lost without it when it comes to Python.

    Download Visual Studio Code - Mac, Linux, Windows
      My Computers


  2. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1562

    Added another cool pattern spooky_flash() , that I pulled out of this example.
    https://github.com/pimoroni/pimoroni...a_stick/pir.py

    Been a rough day (chronic pain wise) and I was needing a distraction. So far so good. Kim Mitchel Big Smoke is blasting through my PC speakers. And I think I may go outside and have my own Big Smoke. It's legal in Canada eh.
    Also been slowly sipping on a Rum & Coke.
      My Computer


  3. Posts : 5,707
    insider build 10586.3 win10 pro 64
       #1563

    alphanumeric said:
    Added another cool pattern spooky_flash() , that I pulled out of this example.
    https://github.com/pimoroni/pimoroni...a_stick/pir.py

    Been a rough day (chronic pain wise) and I was needing a distraction. So far so good. Kim Mitchel Big Smoke is blasting through my PC speakers. And I think I may go outside and have my own Big Smoke. It's legal in Canada eh.
    Also been slowly sipping on a Rum & Coke.
    nasty habbits I have none ,lol ,quit smoking cold turkey yrs ago ,cant remeber the last time i had even a beer ! my older brother died at a wedding reception [he aspirated outside having drinks ] his drinking buddies brought him home ,mother woke me to help carry him in the house ,in the bedroom i reailsed he was dead ,and then had to wake my parents up to tell them ,not a night i'll ever forget , i was working at a tavern at the time ,and did my my fair share of drinking back then
    Last edited by caperjack; 05 Mar 2024 at 18:50.
      My Computer


  4. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1564

    I rolled one up, didn't actually lite it up though. Had two drinks and called it a night. Having a nice early morning cup of Java at the moment. Think I'm going to try and clean up the disaster area, I call my desk, some time today.
      My Computer


  5. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1565

    Modified my Pi 5 Pibow case. RTC Battery is now hidden out of sight in the bottom of the case under the Pi 5. Some of the cable is still visible but I can live with that. No ugly battery sitting on top anymore. Only had to cut one small slot in the bottom layer so the cable isn't pinched anywhere. Also soldered in two pin plug in header for the accessory power button. Those two solder pads I "thought" were for the battery. The built in power button is a bit of a pain to use as its blocked a bit by my NVMe case extension. Another small Pibow layer modification was needed for that. My Dremel and a very small grinding attachment took care of that.
      My Computer


  6. Posts : 305
    Win 10 and 11
       #1566

    alphanumeric said:
    Modified my Pi 5 Pibow case. RTC Battery is now hidden out of sight in the bottom of the case under the Pi 5. Some of the cable is still visible but I can live with that. No ugly battery sitting on top anymore. Only had to cut one small slot in the bottom layer so the cable isn't pinched anywhere. Also soldered in two pin plug in header for the accessory power button. Those two solder pads I "thought" were for the battery. The built in power button is a bit of a pain to use as its blocked a bit by my NVMe case extension. Another small Pibow layer modification was needed for that. My Dremel and a very small grinding attachment took care of that.
    Do you have any pictures? I would love to see how it all comes together.
      My Computers


  7. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1567

    I posted some earlier in this thread. Will take some new ones and post them latter today some time.
      My Computer


  8. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1568

    I will try and get those pics of my Pi 5 case up today. I took them, just have to transfer them off of my Camera and resize them so I can upload them here. The hi res ones right off of the camera are too big file size wise to upload. I'll just use the snipping tool to get ones that will upload OK.

    I was going to do it last night but got sidetracked tinkering with some servo's.
    While looking for something else I found I had one off these. Unassembled Mini Pan-Tilt Kit (Without Micro Servos) : ID 1968 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits
    And a couple spare servos. Micro 1800 Angular Rotation Servo (FS90)
    That let me build one of these. Adafruit Mini Pan-Tilt Kit - Assembled with Micro Servos

    At some point I had ordered the pre assembled Pan Tilt Kit, with the Pan Tilt Hat from Adafruit. It had unfortunately been assembled incorrectly. The Pan servo wasn't centered, and promptly damaged itself the first time I tried to set it up and use it. It went up against the stop and striped a gear before I could kill the power. All I needed was a replacement servo but they sent me another pre-assembled replacement. That one I disassembled, centered the servos, and reassembled.

    I already have a spare V2 camera, and a Pi 4B that's not doing any dedicated task.
    Just ordered the last bit I need on sale even. Pan-Tilt HAT - without Pan-Tilt module
    And another one of these, it was also on sale. Inventor 2040 W (Pico W Aboard)

    I already have an Inventor, nice piece of kit. Mine has a rotary encoder and OLED display added. It's great for testing servo's, and centering them for you.
      My Computer


  9. Posts : 2,191
    Windows 10 Pro 64-bit v22H2
       #1569

    On the Pi 5 are you doing any GPIO programming? If so, are you using C or Python and what library are you using with that?

    People have found that following libraries do not work on the Pi 5:
    • C: WiringPi
    • Python: RPi.GPIO

    I have found the following libraries do work on the Pi 5:
    • C: gpiod & lgpio
    • Python: gpiod, lgpio & gpiozero

    BTW, someone developed what they call a shim which converts library calls to another library. I installed one of those on the Pi 5. With that I was able to run a Python program using RPi.GPIO.

    I don't know about all but at least some of the libraries are entirely C. However, they may come with a Python version which internally converts the Python code to call the C library.

    The Python gpiozero library is unique. Internally on the Pi 4 and earlier it calls the RPi.GPIO libary. They modified it so that if it is installed on a Pi 5 it instead internally calls the lgpio library.
      My Computers


  10. Posts : 15,037
    Windows 10 IoT
    Thread Starter
       #1570

    My Pi 5 is one of very few Pi's I own that doesn't have something connected to the GPIO Header.

    I code in Python on my Pi's. And Micro Python on my Pico's. A lot of the Pimoroni libraries are C wrapped in Python. On the Pico Micro Python side of things anyway.

    What can catch you out on a Pi 5 is the addition of the RP1 chip. It does a lot of the GPIO stuff that the SOC used to do. I do believe that's why you have to use the lgpio library on a Pi 5? I'm still slowly coming to grips with all the changes.

    The big change that has put a wrench into for me is the Python PIP Virtual Environment.
    Installing Pi OS Legacy will stop that from rearing its ugly head, but you can't run Legacy on a Pi 5. You have to run Bookworm on a Pi 5.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:34.
Find Us




Windows 10 Forums