I have tried for several days to get my RPi button press accessible through Dataplicity on my phone. I know it is a custom action with on/off, but I am unable to get the interface with on/off to control my button press. The example is for a red and green light on/off. I essentially have a cluster of lights hooked up through a relay to pin 17. Pin 18 controls the button and pin 17 works the relay. One press of the button turns the Christmas lights on for the allotted amount of time I specified. Any suggestions? The link to the example code is:
https://docs.dataplicity.com/docs/custom-actions-gpio
Just not sure how to merge the two. This is my first major project and I have no background in programming.
the button press code is as follows:
from gpiozero import Button
from gpiozero import OutputDevice
from time import sleep
relay1 = OutputDevice(17)
button = Button(18)
x = 0
relay1.off()
while x < 1:
print("Lights off...")
button.wait_for_press()
print("The button was pressed!")
relay1.on()
print("Lights on...")
print("Waiting...")
sleep(60)
relay1.off()
I tried leaving the red portion out of the code in Dataplicity, but I am not sure how to get it to include the relay portion
Right now, under custom actions on my phone it says Control LEDs
Green LED and then it shows a spinning wheel that never loads
Any suggestions are appreciated =(
Could it be that at the end of the button press you're not returning an "OK" status for the custom action?
Similarly as per the example in the document that you linked:
# Custom Action executed succesfully
echo "[[[ReturnOK]]]"
Best regards,
Dataplicity 🤗
Related
I have created an app with Power Apps for door to door agents using a Map component as the main part. The agent would see a bunch of pins on the map and select a pin nearby. The information behind this pin is then populated in a form next to the map. The datasource is a Sharepoint List.
Setup below is a new simplified version of the app: a screen with two controls:
Map (mapTest): source = Sharepoint List with 4 columns (Title, Label, Lat, Long)
Label (labelTest): Text property = mapTest.Selected.Label
When I start the app, the pin is shown, so the data gets fetched from the Sharepoint List.
When I click on the pin, the info card with all values is shown but the mapTest.Selected value stays blank.
I'm aware that I should use variables but even then it doesn't work.
The app worked fine for a couple of weeks but since today the Selected property of the Map stays blank when I select a pin on the map. I haven't changed anything to the app. I've created a new app to find the cause but no success. Is it possible that Microsoft pushed an update without warning?
I also noticed that the onclick events fire both, when a pin is selected and when the map is clicked. It did not use to do so.
We used the "click map" to re-center/zoom and the "select" to pick the information from the Pin. Now it re-centers both when you click a pin and when you click the map (and it does not pick the information from the pin) :(
I made a program with processing and arduino to control RGB led using processing
then I made application .exe from my processing code
the problem is the application work without close and minimize button .
how can i add it for my application ?
be sure that you Uncheck the Presentation Mode
You need to make sure the "Presentation Mode" checkbox is unchecked:
If this is checked, your sketch is displayed in full screen. If it's unchecked, your sketch is displayed in a window.
I'm making a robot using an arduino motherboard and an Ethernet shield. The Ethernet shield is setup so that if I type http://www.robotip.com/?1 it gives power to pin 1, if I type http://www.robotip.com/?2 it gives power to pin 2. So I have a button and rather then a normal button clicking it sends 1 command I would like to be able to hold the button and have it send ?1 every second that the button is held. What can i use to achieve this? I know this is a very confusing question lol thanks a lot.
If you're making a "control interface" with a webpage,
you should use javascript (Jquery is a nice javascript library)
Using get function you can send the commands asynchronous so it won't refresh the page every time you want to send some data to the robot.
And it also have a mousedown method, that is just what you want, it will do something while the mouse button is .. pressed.
Then you can put your timed requests inside the mousedown method.
I have been trying to play a sound on my laptop by pressing a homemade button on my Arduino.
Now I found this example code to play a file with Minim.
I want to know where I can trigger the button in the code, to play the sound.
Can somebody help me?
Try By looking here Arduino and Processing
This page explains communication examples and how to communicate between arduino and processing
And then you just need to call "player.play();"(from the example you need to remove it)
once the user presses the button
Is there any way to obtain the keypress info for the green-tick (green check marked key) present in the input panel/ virtual keyboard?
Our application is for symbian touch devices. In my application I wanted the url to start loading as soon as the QLineEdit has been edited i.e., as soon as the green check marked key in VKB has been pressed.
I tried using the CloseSoftwareInputPanel event to get notified when the editing is completed in the QLineEdit i.e., when the green check marked key is pressed in the VKB, but that event occurs only after the QLineEdit loses focus (when I tap anywhere on the screen). Is there any other way to get it done?
Thanks
The virtual keyboard is implemented as a front-end processor (FEP) and it's quite invisible to applications.
Note that there are Symbian touch devices that also have a physical keyboard. Not for those devices alone, you should have a Go button or similar and observe returnPressed signal.