Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. LasNiko
    3. Posts
    L
    • Continue chat with LasNiko
    • Start new chat with LasNiko
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by LasNiko

    • RE: M5Stack (Stick|Atom) with Xiaomi LYWSD03MMC

      Most likely possible through GATT client
      https://docs.micropython.org/en/latest/library/ubluetooth.html#gatt-client

      posted in PROJECTS
      L
      LasNiko
    • Check your uPython version

      0_1612516245921_1612516092645.jpg

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      import uos
      
      setScreenColor(0x000000)
      
      vstart = None
      vsysinfo = None
      vsecs = None
      vmins = None
      vtimetext = None
      
      battery = M5TextBox(0, 0, "loading", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
      uptime = M5TextBox(0, 32, "loading", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
      lb_sysinfo = M5TextBox(0, 64, "loading", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
      
      import math
      
      lcd.setBrightness(10)
      vstart = time.ticks_ms()
      vsysinfo = uos.uname()
      lb_sysinfo.setText(str(vsysinfo))
      while True:
        battery.setText(str((str(((str('Battery: ') + str((power.getBatteryLevel()))))) + str('%'))))
        vsecs = round(((time.ticks_ms()) - vstart) / 1000)
        vmins = math.floor(vsecs / 60)
        vtimetext = (str((vsecs % 60)) + str('s'))
        if vmins != 0:
          vtimetext = (str(((str(vmins) + str('m ')))) + str(vtimetext))
        vtimetext = (str('Uptime: ') + str(vtimetext))
        uptime.setText(str(vtimetext))
        wait_ms(2)
      
      posted in PROJECTS
      L
      LasNiko
    • Super simple RGB mixer

      0_1612452214674_IMG_20210204_162014.jpg

      My first time working with this hardware and UIflow / uPython I made a super simple RGB mixer.

      (ty felmue for teaching me how to format code)

      from m5stack import 
      from m5ui import 
      from uiflow import 
      
      setScreenColor(0x222222)
      
      varBarFactor = None
      varR = None
      varG = None
      varB = None
      varHexR = None
      varHexG = None
      varHexB = None
      
      lb_RGBval = M5TextBox(26, 8, RGB, lcd.FONT_UNICODE, 0xFFFFFF, rotate=90)
      rec_R = M5Rect(44, 240, 50, 0, 0xff0000, 0xff0000)
      rec_G = M5Rect(133, 240, 50, 0, 0x00ff00, 0x00ff00)
      rec_B = M5Rect(224, 240, 50, 0, 0x0000ff, 0x0000ff)
      
      def workR()
        global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
        if btnA.isPressed()
          varR = varR + 1
          if varR  255
            varR = 0
          rec_R.setSize(height=int((varR  varBarFactor)))
          rec_R.setPosition(y=(240 - int((varR  varBarFactor))))
          varHexR = str(hex(varR))[2]
          if len(varHexR)  2
            varHexR = (str('0') + str(varHexR))
      
      def workG()
        global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
        if btnB.isPressed()
          varG = varG + 1
          if varG  255
            varG = 0
          rec_G.setSize(height=int((varG  varBarFactor)))
          rec_G.setPosition(y=(240 - int((varG  varBarFactor))))
          varHexG = str(hex(varG))[2]
          if len(varHexG)  2
            varHexG = (str('0') + str(varHexG))
      
      def workB()
        global varBarFactor, varR, varG, varB, varHexR, varHexG, varHexB
        if btnC.isPressed()
          varB = varB + 1
          if varB  255
            varB = 0
          rec_B.setSize(height=int((varB  varBarFactor)))
          rec_B.setPosition(y=(240 - int((varB  varBarFactor))))
          varHexB = str(hex(varB))[2]
          if len(varHexB)  2
            varHexB = (str('0') + str(varHexB))
      
      lcd.setBrightness(10)
      varBarFactor = 0.95
      varHexR = '00'
      varHexG = '00'
      varHexB = '00'
      varR = 0
      varG = 0
      varB = 0
      while True
        workR()
        workG()
        workB()
        rgb.setColorAll((varR  16)  (varG  8)  varB)
        lb_RGBval.setText(str((str('RGB #') + str(((str(varHexR) + str(((str(varHexG) + str(varHexB))))))))))
        wait_ms(2)
      
      posted in PROJECTS
      L
      LasNiko
    • Write characteristic to BLE device

      I need my Core to write a characteristic to a BLE device (lightbulb) like so:
      http://slides.com/helenst/ble#/0/17

      How can I do that in UIflow or Micropython?

      posted in UIFlow
      L
      LasNiko
    • RE: Tutorial: Using COM.LoRaWAN in UIFlow

      Great job. Does this work the same with the old (blue) LoRaWAN module?

      posted in Modules
      L
      LasNiko
    • LoRaWan And M5 Fire hardware modification

      I want to use the LoRaWAN module with the Fire Core.
      I am confused about the necessary hardware modifications. It says:

      • M5Stack Fire has occupied GPIO16 / 17 to connect with the PSRAM by default, it's conflict with TXD / RXD (GPIO16, GPIO17) in this module. Therefore, when using the LoRaWAN module with the M5Stack Fire, you might have to cut the TXD and RXD from GPS module and wire fly to another set of UART pin, if you gonna use the PSRAM.

      Why does it talk about a GPS module? What connections am I meant to cut? Could someone please clarify?

      posted in Modules
      L
      LasNiko