The Raspberry Pi Thread [6]


  1. Posts : 5,719
    insider build 10586.3 win10 pro 64
       #1661

    alphanumeric said:
    Also tinkered a bit with these.
    Attachment 409840
    The top one is an Omnibus With a Display Pack, Pico, and Proto Pack board. Something to mess with when I'm board.
    The bottom one is an Adafruit Can Bus PicoBell, Pico, and Adafruit PicoBell Proto Board. I want to eventually try to use this to connect to my Cars CanBuss diagnostics port. You can't see it but The Adafruit Proto board has a Reset Button and a Run Switch. I think I'll be switching to these over what Pimoorni offers.
    Adafruit PiCowbell CAN Bus for Pico - MCP2515 CAN Controller : ID 5728 : Adafruit Industries, Unique & fun DIY electronics and kits
    Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT : ID 5200 : Adafruit Industries, Unique & fun DIY electronics and kits
    i have a simular setup ,to the pico setup .doing nothing ,but looking pretty !
      My Computer


  2. Posts : 321
    Win 10 and 11
       #1662

    alphanumeric said:
    Also tinkered a bit with these.
    Attachment 409840
    The top one is an Omnibus With a Display Pack, Pico, and Proto Pack board. Something to mess with when I'm board.
    The bottom one is an Adafruit Can Bus PicoBell, Pico, and Adafruit PicoBell Proto Board. I want to eventually try to use this to connect to my Cars CanBuss diagnostics port. You can't see it but The Adafruit Proto board has a Reset Button and a Run Switch. I think I'll be switching to these over what Pimoorni offers.
    Adafruit PiCowbell CAN Bus for Pico - MCP2515 CAN Controller : ID 5728 : Adafruit Industries, Unique & fun DIY electronics and kits
    Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT : ID 5200 : Adafruit Industries, Unique & fun DIY electronics and kits
    Just a head's up. The CAN bus is hard to hack and you can screw up your car with a bug. (I know, I have been fiddling)

    The alternative is to use a bluetooth ODB reader. The info is fairly well documented and it has all of the parameters of your car available. Just have a bluetooth module on your Pico or Pi or whatever you use. I found some cheap at AliExpress. If I have time later today I will look one up for you.
      My Computers


  3. Posts : 15,076
    Windows 10 IoT
    Thread Starter
       #1663

    @Catnip Thanks for the heads up. That project is way down on my list of things to do.
      My Computer


  4. Posts : 15,076
    Windows 10 IoT
    Thread Starter
       #1664

    Was tinkering with this today.
    The Raspberry Pi Thread [6]-encoder.png

    It's a test setup so I can code for the encoder wheel. Tinkering with planed changes to my desktop RGB LED light setup.
    So far I have the encoder wheel moving a marker corresponding to the wheel position. And adjust the brightness as the wheel is moved. The buttons on the Encoder Wheel set the color and rotating the wheel sets the brightness.
    Saves me from having to actually mess with my Plasma Stick 2040 W working Code. Plus I can use the desktop lighting to actually see what I'm doing while coding. I was at it at 3AM this morning. I couldn't seep so I got up. Was at it until about 6:30 AM.

    My current setup does adjust the brightness with the Encoder Wheel. But for now, it lights up to match what was selected. Up gets you a full white circle on the Encoder Wheel that gets brighter or dimmer as the wheel is turned. I'd rather a marker with an arch/trail of lit LED's behind it. Going to be fun "I hope" and a nice distraction from what ails me.
    Last edited by alphanumeric; 3 Days Ago at 03:43.
      My Computer


  5. Posts : 5,719
    insider build 10586.3 win10 pro 64
       #1665

    alphanumeric said:
    Also tinkered a bit with these.
    Attachment 409840
    The top one is an Omnibus With a Display Pack, Pico, and Proto Pack board. Something to mess with when I'm board.
    The bottom one is an Adafruit Can Bus PicoBell, Pico, and Adafruit PicoBell Proto Board. I want to eventually try to use this to connect to my Cars CanBuss diagnostics port. You can't see it but The Adafruit Proto board has a Reset Button and a Run Switch. I think I'll be switching to these over what Pimoorni offers.
    Adafruit PiCowbell CAN Bus for Pico - MCP2515 CAN Controller : ID 5728 : Adafruit Industries, Unique & fun DIY electronics and kits
    Adafruit PiCowbell Proto for Pico - Reset Button & STEMMA QT : ID 5200 : Adafruit Industries, Unique & fun DIY electronics and kits
    digging around I found one like the top one .
      My Computer


  6. Posts : 15,076
    Windows 10 IoT
    Thread Starter
       #1666

    @caperjack You may have gotten that from me in one of our tech bits & bytes swaps.

    Sorted out my Rotary Encoder Switch code. Fabed up a new test setup and borrowed my OLED form the other one.
    As I turn the ring on the encoder the LED's light up one by one in a string going clockwise. And as I turn the ring they get brighter and brighter. My LED String on the Plasma Sticks Brightness will follow what the ring does. Turn it counter clockwise and it goes down. At the same time the arch on the Encoder gets shorter and dimmer.

    The Raspberry Pi Thread [6]-test_setup.png
    The Position is the rotary switch position from 0 to 23 going clockwise. It's at Position 8. The Level is the brightness from 0 to 1.0. I use this as the V in HSV.
    Code:
    import time
    import plasma
    import machine
    import micropython
    
    from plasma import plasma_stick
    
    from pimoroni_i2c import PimoroniI2C
    i2c = PimoroniI2C(4, 5)
    
    from breakout_encoder_wheel import BreakoutEncoderWheel, UP, DOWN, LEFT, RIGHT, CENTRE, NUM_BUTTONS, NUM_LEDS
    
    from plasma import plasma_stick
    
    from picographics import PicoGraphics, DISPLAY_I2C_OLED_128X128
    display = PicoGraphics(display=DISPLAY_I2C_OLED_128X128, bus=i2c)
    display.set_font("bitmap8")
    display.set_pen(0)
    display.clear()
    
    red = (1 / 360)
    green = (130 / 360)
    blue = (250 / 360)
    yellow = (60 / 360)
    orange = (30 / 360)
    white = (1.0)
    
    wheel = BreakoutEncoderWheel(i2c)
    BUTTON_NAMES = ["Up", "Down", "Left", "Right", "Centre"]
    last_pressed = [False] * NUM_BUTTONS
    pressed = [False] * NUM_BUTTONS
    #wheel = BreakoutEncoderWheel(i2c)
    
    # Variables
    #position = 1
    #brightness = 0
    
    # Set the first LED
    wheel.clear()
    wheel.set_hsv(0, 1.0, 0, 1.0)
    wheel.set_hsv(6, red, 1.0, 1.0)
    wheel.set_hsv(12, green, 1.0, 1.0)
    wheel.set_hsv(18, blue, 1.0, 1.0)
    wheel.show()     
    
    display.set_pen(15)
    display.text("Position 0", 0, 10, scale = 2)
    display.text("Level 0", 0, 40, scale = 2)
    display.text("Color White", 0, 70, scale = 2)
    display.update()
    
    # Simple function to clamp a value between 0.0 and 1.0
    def clamp01(value):
        return max(min(value, 1.0), 0.0)
    def clamp02(value):
        return max(min(value, 24.0), 0.0)
    
    
    # Loop forever
    while True:
        
        # Has the dial been turned since the last time we checked?
        change = wheel.delta()
        if change != 0:
            print("Count =", wheel.count())
            
            # Record the new position (from 0 to 23)
            LED = wheel.step() + 1
            print("LED =", LED)
            
            #hue = wheel.revolutions() % 1.0
            brightness = (wheel.step() * 4) / 100
            #brightness = clamp01(brightness)
            #position = clamp02(position)
    
            display.set_pen(0)
            display.clear()
            display.set_pen(15)
            display.text("Position {:.0f}".format(wheel.step()), 0, 10, scale = 2)
            display.text("Level {:.4f}".format ((wheel.step() * 4) / 100), 0, 40, scale = 2)
            display.text("Color White", 0, 70, scale = 2)
            display.update()                
    
            # Set the LED at the new position to the new hue
            wheel.clear()
            
            for w in range(LED):
                wheel.set_hsv(w, 1.0, 0, brightness)
            
            #wheel.set_hsv(position, 1.0, 0, brightness)
            wheel.show()
    Last edited by alphanumeric; 2 Days Ago at 16:00.
      My Computer


  7. Posts : 5,719
    insider build 10586.3 win10 pro 64
       #1667

    You may have gotten that from me in one of or tech bits & bytes swaps.


    [/CODE]
    I think you might be right .
      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 11:23.
Find Us




Windows 10 Forums