🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to read Standard RC signal

    Lessons and Guides
    5
    8
    14.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pattiuak
      last edited by

      I want to read Standard RC PWM input signal on port A (or B, C). Standard RC PWM signal is between 1.5 ms to 2 ms and have timeout at 20 ms. How to do it in UI FLOW.

      PS.
      Something that similar to "pulseIn" command in arduino?

      ajb2k3A 1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3 @pattiuak
        last edited by

        @pattiuak said in How to read Standard RC signal:

        I want to read Standard RC PWM input signal on port A (or B, C). Standard RC PWM signal is between 1.5 ms to 2 ms and have timeout at 20 ms. How to do it in UI FLOW.

        PS.
        Something that similar to "pulseIn" command in arduino?

        there isn't a dedicate pwm read block,( and I am way behind with my experiments,) Have you tried playing with the analogue or digital pin reads?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        P 1 Reply Last reply Reply Quote 0
        • P
          pattiuak @ajb2k3
          last edited by

          @ajb2k3 As I Know

          • analog read will read voltage input from 0 V. to 5 V. in this case it will pickup either 0 V. or full 5 V. (depend on PWM duty when you read it). So analog read is useless for this case.

          • digital pin read is just get 0 or 1. But if I can get delta time between it change from 0 to 1 and change back from 1 to 0 it will work. But UI FLOW don't have any block that can read processing time. So it impossible to read duty time with digital pin read only.

          1 Reply Last reply Reply Quote 1
          • H
            heybin
            last edited by

            @pattiuak said in How to read Standard RC signal:

            But if I can get delta time between it change from 0 to 1 and change back from 1 to 0 it will work. But UI FLOW don't have any block that can read processing time. So it impossible to read duty time with digital pin read only.

            sorry, uiflow now not support it

            1 Reply Last reply Reply Quote 0
            • H
              hetzer
              last edited by

              Hope it supports in the future. I need a similar function to read sbus signal.

              1 Reply Last reply Reply Quote 1
              • H
                hetzer
                last edited by

                Is it possible to do it now with the ticks ?

                1 Reply Last reply Reply Quote 0
                • H
                  hetzer
                  last edited by

                  Hope you still consider adding sbus blocks to uiflow. It would be very useful with all the servo controller units available for m5stack products.

                  1 Reply Last reply Reply Quote 0
                  • H
                    holofloh
                    last edited by

                    Method 1: As far as I know the pulse goes from 1ms to 2ms (1.5ms is middle position). It should be possible to "analogify" or mathematically say "integrate" the PWM signal using a R-C combination on the input pin and read the voltage from this. But the voltage level will be low due the duty cycle which goes from approx. 1:20 (1ms/20ms) to 1:10 (2ms/20ms). From 5V full scale you read 0.25V to 0.5V. You may add an analog OPAMP amplify it to 5V. This method will slow down the reaction time a little bit

                    Method 2: Before doing the Method 1 it may be less effort to write it in Arduino and use either a PWM read library or use a interrupt to measure the pulse width. You can also read the low time to determine if the input signal is valid or not eg. to detect signal loss.

                    Method 3: This is the simple but ugly workaround! Add a small Servo to your signal and drive a potentiometer which ist then read by the M5 analog input.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post