Navigation

    M5Stack Community

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

    sleepyfatcat

    @sleepyfatcat

    0
    Reputation
    2
    Posts
    319
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    sleepyfatcat Follow

    Posts made by sleepyfatcat

    • DigitalWrite

      Hello,

      I am trying to use C to on the LED on my M5 stick c plus.

      I have initialise pin 10 as the output, and when I send digitalWrite(led_pin, 0), it ons the LED.

      My code causes the LED to on when 0 is sent, and off when 1 is sent. Any idea why it seemed like it is flipped? Thank you

      posted in Arduino
      S
      sleepyfatcat
    • M5 Stack unable to subscribe and recieve new messages

      Hello everyone, I am trying to print new messages on my m5 stick c plus, through hive mq. I am able to publish, but not able to subscribe. Not sure what is the issue here, please advise! Thank you in advance!

      Here is my code:

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      
      setScreenColor(0x111111)
      
      
      PASSW = None
      CLIENTID = None
      USER = None
      HOST = None
      
      
      
      label0 = M5TextBox(47, 49, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      label1 = M5TextBox(47, 176, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      
      
      PASSW = 'password'
      CLIENTID = 'm5stack'
      USER = 'user'
      HOST = '07ecd30c.s1.eu.hivemq.cloud'
      from m5mqtt import M5mqtt
      
      m5mqtt = M5mqtt(CLIENTID,HOST,8883,USER,PASSW,300,ssl=True,ssl_params={'server_hostname':HOST})
      m5mqtt.start()
      label0.setText('Hello M5')
      
      a = None
      
      def callback(topic_data):
        a = topic_data
        label0.setText(str(a))
        pass
      
      while True:
        m5mqtt.subscribe(str('topic/1'), callback)
      

      My StickCPlus is currently v1.9.8-plus

      posted in M5 Stick/StickC
      S
      sleepyfatcat