Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. how to check 30 mins of inactivity using arduino ?
Servers for Qt installer are currently down

how to check 30 mins of inactivity using arduino ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 4 Posters 1.6k Views 2 Watching
  • 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.
  • J Offline
    J Offline
    jkprog
    wrote on 30 Jun 2017, 19:36 last edited by
    #1

    Hi,
    I am using QT with arduino to control all the gpio pins on the arduino. I have connected gpio pins to the buttons to turn them on or off. Now I want to monitor the time of inactivity (the time during which no QPushButton was pressed/released) . That is if nothing happened for 30 mins, all the pins will turn off.
    I have made a QPushButton to turn off all the lights whenever a user wants to.
    Can anyone suggest a way on how to monitor the inactivity period?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Jun 2017, 22:12 last edited by
      #2

      Hi,

      What is an activity ? What defines the end of the activity ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply 1 Jul 2017, 16:39
      0
      • M Offline
        M Offline
        mvuori
        wrote on 1 Jul 2017, 14:45 last edited by
        #3

        I would add a routine to the pushbuttons' pressed signal that saves a timestamp of the last press and starts a QTimer for 30 min. The slot which QTimer calls would check the timestamp and turn the lights off it 30 min has really passed. If not, call QTimer again.

        J 1 Reply Last reply 1 Jul 2017, 16:59
        0
        • S SGaist
          30 Jun 2017, 22:12

          Hi,

          What is an activity ? What defines the end of the activity ?

          J Offline
          J Offline
          jkprog
          wrote on 1 Jul 2017, 16:39 last edited by
          #4

          @SGaist I mean, when no button is pressed or released for 30 minutes, then all the lights that are turned on should be turned off. I dont know how to check whether no button is pressed or released for 30 mins?

          1 Reply Last reply
          0
          • M mvuori
            1 Jul 2017, 14:45

            I would add a routine to the pushbuttons' pressed signal that saves a timestamp of the last press and starts a QTimer for 30 min. The slot which QTimer calls would check the timestamp and turn the lights off it 30 min has really passed. If not, call QTimer again.

            J Offline
            J Offline
            jkprog
            wrote on 1 Jul 2017, 16:59 last edited by
            #5

            @mvuori that is just for 1 button. I have more than 60 buttons to monitor. If the user doesn't press/release any of the 60 buttons, then all the buttons should be turned off.

            M 1 Reply Last reply 1 Jul 2017, 19:52
            0
            • J jkprog
              1 Jul 2017, 16:59

              @mvuori that is just for 1 button. I have more than 60 buttons to monitor. If the user doesn't press/release any of the 60 buttons, then all the buttons should be turned off.

              M Offline
              M Offline
              mvuori
              wrote on 1 Jul 2017, 19:52 last edited by
              #6

              @jkprog And? When you generate the buttons, just add the same signal-slot connection to each. As per your description, you just need to know when the last button press was made. Make one slot that doesn't care where the pressed signal comes from. I see no problem here.

              1 Reply Last reply
              1
              • V Offline
                V Offline
                VRonin
                wrote on 3 Jul 2017, 07:37 last edited by
                #7

                Not sure if it works on Arduino but for standard operating systems there's: https://api.kde.org/frameworks/kidletime/html/index.html

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                1

                1/7

                30 Jun 2017, 19:36

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved