Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
feadi78
feadi78's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Arduino stepper motor interface
[2 Replies]
27-Jan-2011 04:09 AM
Forum:
Integration and Hardware
Hello!
I'm building an interface in processing (ControlP5) to control a stepper-motor with an ArduinoUNO communicating with "
Arduino Library for Processing (and Firmata)
"
I have a probably very simple problem: How do I stop the loop for turning the motor by pressing a button in processing?
void move (int speed, int turns, int pause, int repeat){
for (int i = 0; i < repeat; i = i+1) {
for (int j = 0; j < turns; j = j+1) {
arduino.digitalWrite(13, Arduino.HIGH);
delay(speed);
arduino.digitalWrite(13, Arduino.LOW);
delay(speed);
}
delay(pause);
}
}
Since the program is busy with the delays it won't allow me to check a button status while running.
I guess I have to use a timer function but I'm getting confused whether this has to run on the Arduino or in processing.
Can somebody give me a push in the right direction?
«Prev
Next »
Moderate user : feadi78
Forum