BlueWave Studio forum
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:
  • Home
  • Help
  • View Today's Post
  • More
    • BlueWave Studio
    • Shop
User Links
  • Login
  • Register
  • Login Register
    Login
    Username:
    Password:

    Quick Links Home Help View Today's Post
    More
    • BlueWave Studio
    • Shop
    BlueWave Studio forum Development Suggestions and Feedback Ability to have user-defined buttons that drive gpio

    Ability to have user-defined buttons that drive gpio
    waj334
    Offline

    Junior Member

    Posts: 2
    Threads: 2
    Joined: Oct 2020
    Reputation: 2
    #1
    10-31-2020, 05:30 PM
    Hi all,

    It would be a nice addition to have user-defined buttons that can drive a gpio pin high or low and have a different icon and/or label text for both on/off states. For my application, I want to control a relay that would turn my amplifiers on or off.

    Currently I'm gonna use the existing external application mechanism to get by, but the user experience is not going to be great.
    3063DPrinting
    Offline

    Junior Member

    Posts: 19
    Threads: 4
    Joined: Dec 2020
    Reputation: 0
    #2
    12-14-2020, 10:28 PM
    (10-31-2020, 05:30 PM)waj334 Wrote: Hi all,

    It would be a nice addition to have user-defined buttons that can drive a gpio pin high or low and have a different icon and/or label text for both on/off states. For my application, I want to control a relay that would turn my amplifiers on or off.

    Currently I'm gonna use the existing external application mechanism to get by, but the user experience is not going to be great.
    I to am looking to link other devices to my GPIO to control my hvac system on my vehicle. Did you have any luck setting up user defined buttons within openaudio. If not were you able to access your external application through openaudio?
    Great
    Offline

    Member

    Posts: 83
    Threads: 3
    Joined: Apr 2020
    Reputation: 8
    #3
    12-15-2020, 09:28 AM
    You have to edit openauto_applications.ini configuration file.

    Have a look at this: https://bluewavestudio.io/community/show...p?tid=2049
    budman1758
    Offline

    Member

    Posts: 65
    Threads: 8
    Joined: Apr 2020
    Reputation: 1
    #4
    12-16-2020, 01:38 AM
    There is an external application you could try.  Very useful for many things.
    RPIEasy
    "The glass is twice as big as it needs to be".
    Justindu
    Offline

    Member

    Posts: 150
    Threads: 25
    Joined: Jul 2020
    Reputation: 5
    #5
    12-17-2020, 07:29 AM (This post was last modified: 12-17-2020, 07:30 AM by Justindu.)
    (12-14-2020, 10:28 PM)3063DPrinting Wrote:
    (10-31-2020, 05:30 PM)waj334 Wrote: Hi all,

    It would be a nice addition to have user-defined buttons that can drive a gpio pin high or low and have a different icon and/or label text for both on/off states. For my application, I want to control a relay that would turn my amplifiers on or off.

    Currently I'm gonna use the existing external application mechanism to get by, but the user experience is not going to be great.
    I to am looking to link other devices to my GPIO to control my hvac system on my vehicle. Did you have any luck setting up user defined buttons within openaudio. If not were you able to access your external application through openaudio?

    I turned my touch screen into a button map using a python app - that triggers relays.  The relays act as physical buttons connected to the Stack display unit.

    3063DPrinting
    Offline

    Junior Member

    Posts: 19
    Threads: 4
    Joined: Dec 2020
    Reputation: 0
    #6
    12-17-2020, 03:26 PM (This post was last modified: 12-17-2020, 06:10 PM by Daniel_BlueWave.)
    Which software or text editor did you use to make your GUI?
    Justindu
    Offline

    Member

    Posts: 150
    Threads: 25
    Joined: Jul 2020
    Reputation: 5
    #7
    12-17-2020, 04:16 PM (This post was last modified: 12-17-2020, 04:19 PM by Justindu.)
    (12-17-2020, 03:26 PM)3063DPrinting Wrote:
    (12-17-2020, 07:29 AM)Justindu Wrote:
    (12-14-2020, 10:28 PM)3063DPrinting Wrote:
    (10-31-2020, 05:30 PM)waj334 Wrote: Hi all,

    It would be a nice addition to have user-defined buttons that can drive a gpio pin high or low and have a different icon and/or label text for both on/off states. For my application, I want to control a relay that would turn my amplifiers on or off.

    Currently I'm gonna use the existing external application mechanism to get by, but the user experience is not going to be great.
    I to am looking to link other devices to my GPIO to control my hvac system on my vehicle. Did you have any luck setting up user defined buttons within openaudio. If not were you able to access your external application through openaudio?

    I turned my touch screen into a button map using a python app - that triggers relays.  The relays act as physical buttons connected to the Stack display unit.
    Which software or text editor did you use to make your GUI?

    This is a hand coded Python app. I started on my Mac in a text editor called Atom, and eventually finished development on the Pi unit using a text editor called nano.

    But, based on your question, I'm going to assume you are new to Python programming.  Python is easy enough to learn, but it takes time to work out something as complex as a custom GUI.

    Here is an example of a very simple program that launches, paints a full screen button on a 1920x1200 display that has one function - to write a file, create a button, and then on touch of the button, it deletes the file then closes.

    import tkinter as tk
    import os
    import pygame
    pygame.mixer.init()

    from subprocess import Popen #to execute unix commands wout blocking
    root = tk.Tk()
    root.title('RearView')

    #def playsound():
    #    pygame.mixer.music.load("./DashControl/Tink.wav")
    #    pygame.mixer.music.play()

    def CamDisplayOn():
        Popen(["touch", "/tmp/backupcamera_manual"])
        #playsound()

    def CamDisplayOff():
        Popen(["rm", "/tmp/backupcamera_manual"])

    def ButtonDown(event):
        #playsound()
        ##event button map
        if ((0 <= event.x <= 1920) and (0 <= event.y <= 1200)):
            print("CamDisplayOff") #delete /tmp/backupcamera_manual
            CamDisplayOff()
            exit()

    ##write the file on open and display the camera video
    CamDisplayOn()

    ##setup the application window attributes
    root.wm_attributes('-fullscreen','true') #Set window full fullscreen
    root['bg'] = 'black' #set the background color
    frame = tk.Frame(root, width=1920, height=1200) #set the app window size
    filename = tk.PhotoImage(file = "./wallpaper.png") #set the background image file location
    background_label = tk.Label(root, image=filename) #create a label to place on the Frame
    background_label.place(x=0, y=0, relwidth=1, relheight=1) #place the label on frame
    ##bind mouse events to the background_label
    background_label.bind("", ButtonDown)

    frame.pack()
    background_label.tkraise()
    root.mainloop()
    3063DPrinting
    Offline

    Junior Member

    Posts: 19
    Threads: 4
    Joined: Dec 2020
    Reputation: 0
    #8
    12-17-2020, 07:35 PM (This post was last modified: 12-17-2020, 08:54 PM by Daniel_BlueWave.)
    I am new to python. I have a little experience with Arduino and visual basic code. I am in the early stages of integrating a PI into my restomod project. My goal is to make a application to control servo motors that are attached to my HVAC system and a few miscellaneous relays. I would like to access the application through Openauto pro. I have played around with Atom, Sublim text, Pycharm, and visual studio code. But I am having a hard time building and attractive GUI for my application. I am starting to play around with QtDesign and hope I can make something aesthetically pleasing and functional. Any suggestions would be appreciated, and if you know of any youtube tutorials that would be amazing.
    jennmike2
    Offline

    Member

    Posts: 138
    Threads: 5
    Joined: Jan 2019
    Reputation: 6
    #9
    12-18-2020, 09:07 AM (This post was last modified: 12-18-2020, 09:09 AM by jennmike2.)
    (12-17-2020, 07:35 PM)3063DPrinting Wrote: I am new to python. I have a little experience with Arduino and visual basic code. I am in the early stages of integrating a PI into my restomod project. My goal is to make a application to control servo motors that are attached to my HVAC system and a few miscellaneous relays. I would like to access the application through Openauto pro. I have played around with Atom, Sublim text, Pycharm, and visual studio code. But I am having a hard time building and attractive GUI for my application. I am starting to play around with QtDesign and hope I can make something aesthetically pleasing and functional. Any suggestions would be appreciated, and if you know of any youtube tutorials that would be amazing.

    Page 5 has 1st episode. not YouTube but....  this one is retired but I still learned a lot and best coding walkthrough that was thorough.

    https://twit.tv/shows/coding-101
    Tested build hardware that works!!!

    https://bluewavestudio.io/community/show...p?tid=2106
    nbesnerson
    Offline

    Junior Member

    Posts: 6
    Threads: 3
    Joined: Dec 2019
    Reputation: 0
    #10
    01-13-2021, 09:33 AM
    I also would find this feature useful, as opposed to having to call an external application to perform GPIO setting functions.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)

    Pages ({1}): 1 2 Next »



    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Help · BlueWave Studio · Shop

    Copyright © bluewavestudio.io. All rights reserved.

    Linear Mode
    Threaded Mode