Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    High GPIO Pins

    Scheduled Pinned Locked Moved Expansion Board
    pingpiosipy
    2 Posts 2 Posters 1.1k Views 2 Watching
    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.
    • B Offline
      bradnz
      last edited by

      Hi
      Excuse my ignorance here, but what triggers the idea that a pin is "RISING". I have the following simple code:

      charger_input_detect=Pin('P14', mode=Pin.IN, pull=Pin.PULL_DOWN)
      charger=0

      def pin_handler_rising(arg):
      charger=1

      charger_input_detect.callback(Pin.IRQ_RISING, pin_handler_rising)

      All I want to do is know if the LiPo battery is DONE. I have an output pin which will output Max 2.5V (Im paranoid about putting more than 3.3V on the pin and wrecking it). I figured this code would trigger the interrupt if it sees the put change from its default 0 value (low) to any value. I wouldnt have thought the actual end value would matter too much (within reason).

      Should this actually work do you think?

      Appreciate your feedback in advance :)

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @bradnz
        last edited by

        @bradnz So you want to tell, if the voltage of the LiPo battery is above 2.5 V. That should be done using the ADC, for various reasons.
        a) The value at which a digital input switches from HIGH to LOW is not well defined and not stable. It is somewhere between 0.75 * Vdd and 0.25 * Vdd
        b) You have to check the value of the variable charger anyhow, so instead of doing that you could also read an ADC value. If you want to have that done in an interrupt fashion, you can set-up a timer interrup which reads the ADC,

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • 1 / 1
        • First post
          Last post

        Pycom on Twitter

        Pycom