Society of Robots - Robot Forum
Software => Software => Topic started by: rajsekhar291 on July 19, 2010, 10:10:04 AM
-
please can anyone tell me how to write manual delay function?
and also please tell me how to take input from the sensors
-
Which processor and programming language?
A software delay is pretty simple.
set a variable to a value
decrement the variable
test the variable for equal to zero
if not = 0 then go back and decrement again.
if = 0 exit
-
Which processor and programming language?
A software delay is pretty simple.
set a variable to a value
decrement the variable
test the variable for equal to zero
if not = 0 then go back and decrement again.
if = 0 exit
i want to write in c and i'm using atmega32
i want a delay of 1 second and the _delay_ms() function is not working please help me
-
void delay_1sec (void) {
int i, j;
for( i=0; i<X; i++) {
for( j=0; j<Y; j++) {
;
}
}
}
Is how I would do a generic long delay.
X and Y are constants that need adjustment to get 1 second for your processor speed and compiler's code.
-
void delay_1sec (void) {
int i, j;
for( i=0; i<X; i++) {
for( j=0; j<Y; j++) {
;
}
}
}
Is how I would do a generic long delay.
X and Y are constants that need adjustment to get 1 second for your processor speed and compiler's code.
as long as your compiler's optimisation is switched off.
dunk.
-
void delay_1sec (void) {
int i, j;
for( i=0; i<X; i++) {
for( j=0; j<Y; j++) {
;
}
}
}
Is how I would do a generic long delay.
X and Y are constants that need adjustment to get 1 second for your processor speed and compiler's code.
as long as your compiler's optimisation is switched off.
dunk.
pls tell me how to take input frm sensors