Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. akshaypatil
    A
    • Continue chat with akshaypatil
    • Start new chat with akshaypatil
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    akshaypatil

    @akshaypatil

    1
    Reputation
    16
    Posts
    1696
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    akshaypatil Follow

    Posts made by akshaypatil

    • RE: Help to upgrade battery without any accessory for RGBW lamp project

      @felmue Thank you! Sorry for the late reply, got busy with something.

      Which ports do I add the battery externally? To "bat" and "gnd"?
      I was going to leave it barebones since it's not easy to find an alternative esp32 pico kit with a battery charging circuit onboard. (tiny tiny size)
      Would be cool to have an esp32 mounted on top of a li-ion cell, like how they have the protection circuits.

      posted in M5 Stick/StickC
      A
      akshaypatil
    • Help to upgrade battery without any accessory for RGBW lamp project

      I'm designing a battery-powered lamp for tables with M5StickC and,

      1. Can I replace the 80mah lipo with a 3300mah? (I don't want to use the battery HAT)
      2. How do I disassemble M5stickC beyond the 2 screws? (It's not easy to lift the board and get access to the battery.)
      3. Are there libraries to program RGBW neopixels for UIFLOW?(https://www.adafruit.com/product/2858)

      Thank you!

      posted in M5 Stick/StickC
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @akshaypatil

      from m5stack import *
      from m5ui import *
      from uiflow import *
      from easyIO import *
      
      setScreenColor(0x111111)
      
      
      import BlynkLib
      BLYNK_AUTH = 'YOUR AUTH'
      blynk = BlynkLib.Blynk(BLYNK_AUTH)
      
      
      from machine import Pin
      import _onewire
      
      def init(pin):
        Pin(pin, Pin.OPEN_DRAIN, Pin.PULL_UP)
      
      def convert(pin):
        _onewire.reset(Pin(pin))
        _onewire.writebyte(Pin(pin), 0xcc)
        _onewire.writebyte(Pin(pin), 0x44)
      
      def read(pin):
        _onewire.reset(Pin(pin))
        _onewire.writebyte(Pin(pin), 0xcc)
        _onewire.writebyte(Pin(pin), 0xbe)
        tlo = _onewire.readbyte(Pin(pin))
        thi = _onewire.readbyte(Pin(pin))
        _onewire.reset(Pin(pin))
        temp = tlo + thi * 256
        if temp > 32767:
          temp = temp - 65536
        temp = temp * 0.0625
        return(temp)
      
      init(0)
      
      @blynk.VIRTUAL_READ(6)
      def v6_read_handler():
        blynk.virtual_write(6, "%.2f"%((read(0))))
      
      @blynk.VIRTUAL_WRITE(9) # Button Widget VPIN 9 at GPIO 26
      def my_write_handler(value):
        blynk.virtual_write(1, toggleIO(26))
      
      while True:
        blynk.run()
        convert(0)
        lcd.clear()
        lcd.font(lcd.FONT_DejaVu18)
        lcd.print(("%.2f"%((read(0)))), 15, 50, 0xff0000)
        lcd.print(digitalRead(26), 35, 90, 0xffffff)
        wait_ms(2)
      

      And this will toggle GPIO 26.
      Now with the Blynk "Eventor" widget, you can have a summer fan that switches on when the temperature is higher than 28. ;)

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @robalstona

      from m5stack import *
      from m5ui import *
      from uiflow import *
      
      setScreenColor(0x111111)
      
      import BlynkLib
      BLYNK_AUTH = 'YOUR AUTH'
      blynk = BlynkLib.Blynk(BLYNK_AUTH)
      
      from machine import Pin
      import _onewire
      
      def init(pin):
        Pin(pin, Pin.OPEN_DRAIN, Pin.PULL_UP)
      
      def convert(pin):
        _onewire.reset(Pin(pin))
        _onewire.writebyte(Pin(pin), 0xcc)
        _onewire.writebyte(Pin(pin), 0x44)
      
      def read(pin):
        _onewire.reset(Pin(pin))
        _onewire.writebyte(Pin(pin), 0xcc)
        _onewire.writebyte(Pin(pin), 0xbe)
        tlo = _onewire.readbyte(Pin(pin))
        thi = _onewire.readbyte(Pin(pin))
        _onewire.reset(Pin(pin))
        temp = tlo + thi * 256
        if temp > 32767:
          temp = temp - 65536
        temp = temp * 0.0625
        return(temp)
      
      init(0)
      
      @blynk.VIRTUAL_READ(6)
      def v6_read_handler():
          blynk.virtual_write(6, "%.2f"%((read(0))))
      
      
      while True:
        blynk.run()
        convert(0)
        lcd.clear()
        lcd.font(lcd.FONT_DejaVu18)
        lcd.print(("%.2f"%((read(0)))), 15, 50, 0xff0000)
        wait_ms(2)
      
      

      This will push the ds18b20 temperature to value display widget "Value Display/Labeled Value" on Blynk.
      Don't forget to change the reading rate on this widget from "PUSH" to "1 sec".

      Let me know if it works! :)

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      Nevermind!
      I got it to work!! Yahoo!!!

      Thanks a million for the help! :))

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @robalstona

      from m5stack import *
      from m5ui import *
      from uiflow import *
      
      import machine
      import time
      import onewire
      from dallas import ds18b20 as sensor
      
      setScreenColor(0x111111)
      
      sensor.init(26)
      
      
      while True:
        sensor.convert (26)
        time.sleep_ms(750)
        lcd.print((sensor.read(26)), 0, 0, 0xffffff)
        wait_ms(2)
      
      

      I'm getting "cannot import name ds18b20" error, how do I get around this?

      Thank you for helping me out!

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @robalstona

      from m5ui import *
      from uiflow import *
      
      setScreenColor(0x111111)
      
      
      import time
      import onewire
      from dallas import ds18b20 as sensor
      
      sensor.init( pin )
      
      
      
      while True:
        sensor.convert ( pin )
        time.sleep_ms(750)
        print ( sensor.read( pin ) )
        wait_ms(2)
      

      Is this the basic code to display the temperature?
      Don't hesitate from thinking of me as a complete newbie, I have only been able to figure out basic logic/programming in python.
      The plan is to make a battery-heated lunchbox (my design thesis) that will be activated through blynk (or the button mstickC) and use the temperature reading to create a closed looped-feedback and switch it off.
      As simple as that sounds in my head. (but not really, as I have learned with time)
      :)

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @robalstona Yes, that's exactly what I've been trying, without any success. :/
      I had made my own blocks for toggling GPIO pins in blynk with uiflow that would show a loading screen as soon as I clicked it, but with your blocks, it didn't work. (there is no loading notification)

      If possible, it would be really helpful to see the code in normal python format. So that I could make my own blocks and cross-check if it's not just my computer?

      Cheers!

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @akshaypatil
      The code on github is shown as 1 line, hence the confusion in understanding it even a slight bit. I'm new to programming, have just figured out the basic functions in uiflow, therefore I might be pretty ignorant.

      posted in UIFlow
      A
      akshaypatil
    • RE: Ui Flow support for onewire and ds18x20

      @robalstona
      Hi! I was unable to get your uiflow blocks from github to work,
      the m5b files would not load into uiflow. (nothing happens)
      Are they compatible with uiflow 1.4.5?
      Secondly, I uploaded ds18x20.py using uPyloader and used "import ds18x20" in custom execute command. What steps do I take after to get the data from the sensor?
      If possible, could you paste the python code? Need it for my project.
      Thanks a lot!

      posted in UIFlow
      A
      akshaypatil