-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to read button on Atom #18
Comments
Hello, the function of this case is not open yet, only IO pins are open at present |
Is there a plan when it will be available? Currently the button is pretty useless. |
Hello, I have confirmed that the button function is available, provided that you set it to the input state, I see that you seem to use it directly, maybe you can set it to the input state first, you can use set_pin_mode() to set it , And then use the read function. |
unsubscribe
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2021年7月5日(星期一) 上午10:49
收件人: ***@***.***>;
抄送: ***@***.***>;
主题: Re: [elephantrobotics/myCobot] How to read button on Atom (#18)
Hello, I have confirmed that the button function is available, provided that you set it to the input state, I see that you seem to use it directly, maybe you can set it to the input state first, you can use set_pin_mode() to set it , And then use the read function.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I tried to do that, however without success (tested with Atom 2.8). Do you have some sample code that I could use? Do I have to constantly poll the state of the input or is it possible to react on events? |
#include <MycobotBasic.h>
#include <ParameterList.h>
MycobotBasic myCobot;
void setup(){
myCobot.setup();
myCobot.powerOn();
pinMode(21,OUTPUT);
pinMode(22,OUTPUT);
myCobot.setPinMode(39,INPUT);
}
void loop(){
Serial.println(myCobot.getDigitalInput(39));
delay(200);
} |
Hi,
I could not find any documentation how to read the button on the Atom Lite.
It's supposed to be connected to G39 on the Atom, however the following code does not work when flashed to the basic:
int value = m_mycobotBasic.getDigitalInput(39);
it always returns -1.
How can I get button Events?
The text was updated successfully, but these errors were encountered: