THE ANNIN ROBOTICS FORUM HAS MOVED TO A NEW COMMUNITY. 👉
program with a phys...
 
Notifications
Clear all

program with a physical button instead of the mouse.

6 Posts
5 Users
0 Reactions
70 Views
Avatar of David Sanmiguel
(@david-sanmiguel)
Eminent Member
Joined: 2 months ago
Posts: 12
Topic starter  

Hello Chris,

 

I've completed the robot. It's working. Here I want to start the robot's program with a physical button instead of the mouse. What can I do for this?

 

Thanks...



   
Quote
Chris Annin
(@chris-annin)
Member Admin
Joined: 2 months ago
Posts: 535
 

That is a good idea and one that has been brought up several times. The main issue is that the commands are fed and executed from the windows PC so its hard to have a physical button on the teensy that tells the computer to start sending moves from the command line. I will keep thinking about a way to make this happen. I have thought about trying to find a way to upload the actual motion program to the teensy board and then running without the PC but this will take some development. Let me know if anyone has any ideas on this and I will add this to my list of future updates.



   
ReplyQuote
Johann Voigtlander
(@johann-voigtlander)
Estimable Member
Joined: 2 months ago
Posts: 87
 

Would it be possible to have a Raspberry pi (or similar sbc) running in the electronics enclosure with the AR software running which could then be triggered by a button to execute commands?



   
ReplyQuote
Chris Annin
(@chris-annin)
Member Admin
Joined: 2 months ago
Posts: 535
 

I think that's a good potential solution.



   
ReplyQuote
Oliver Johansson
(@oliver-johansson)
Active Member Customer
Joined: 2 months ago
Posts: 9
 

I've been doing this by just starting the program once from the PC and then having it wait for an input on the arduino (though I use a pi pico) that I have wired a button to. So it's one work around to the problem.



   
ReplyQuote
Avatar of ttrobotics
(@ttrobotics)
Trusted Member
Joined: 2 months ago
Posts: 44
 

@chris-annin

const int buttonPin = 2; // Buton pinini belirtin (örnekte 2 numaralı pin kullanıldı)

const int ledPin = 13; // LED pinini belirtin (örnekte 13 numaralı pin kullanıldı)

 

int buttonState = 0; // Buton durumu değişkeni

 

void setup() {

pinMode(ledPin, OUTPUT); // LED pinini çıkış olarak ayarlayın

pinMode(buttonPin, INPUT); // Buton pinini giriş olarak ayarlayın

}

 

void loop() {

buttonState = digitalRead(buttonPin); // Buton durumunu okuyun

 

if (buttonState == HIGH) { // Buton basıldığında

digitalWrite(ledPin, HIGH); // LED'i yakın

delay(1000); // 1 saniye bekle

digitalWrite(ledPin, LOW); // LED'i söndür

}

}

 

___________________________________________________________________

 

@Chris Annin is it possible with this code? is it ok if i install teensy4.1? Can you test this?



   
ReplyQuote
Share:
Upload your Photo