Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / utilities / robot_wireless_relay / move.c @ 13

History | View | Annotate | Download (1.63 KB)

1
//Created 4/30/06 by James Kong
2

    
3
#include "firefly+_lib.h"
4
//#include "pindefs_ff.h"
5
#include "move.h"
6

    
7
/*
8
Move and turn functions are overloaded so they can be called with or without the speed or time parameters.
9
If called wihtout parameters, the defaults will be used.
10
*/
11

    
12
//Forward
13
void moveForward(void) {
14
        motor1_set(FWD, NRML_SPD);
15
        motor2_set(FWD, NRML_SPD);
16
        delay_ms(DELAY_F);
17
}
18

    
19
/*void moveForward(int speed) {
20
        motor1_set(FWD, speed);
21
        motor2_set(FWD, speed);
22
        delay_ms(DELAY_F);
23
}
24

25
void moveForward(int speed, int time) {
26
        motor1_set(FWD, speed);
27
        motor2_set(FWD, speed);
28
        delay_ms(time);
29
}
30
*/
31
//Back
32
void moveBack(void) {
33
        motor1_set(BCK, HALF_SPD);
34
        motor2_set(BCK, HALF_SPD);
35
        delay_ms(DELAY_B);
36
}
37
/*
38
void moveBack(int speed) {
39
        motor1_set(BCK, speed);
40
        motor2_set(BCK, speed);
41
        delay_ms(DELAY_B);
42
}
43

44
void moveBack(int speed, int time) {
45
        motor1_set(BCK, speed);
46
        motor2_set(BCK, speed);
47
        delay_ms(time);
48
}
49
*/
50
//Turn Left
51
void turnLeft(void) {
52
        motor1_set(FWD, NRML_TURN);
53
        motor2_set(BCK, NRML_TURN);
54
        delay_ms(DELAY_L);
55
}
56
/*
57
void turnLeft(int speed) {
58
        motor1_set(FWD, speed);
59
        motor2_set(BCK, speed);
60
        delay_ms(DELAY_L);
61
}
62

63
void turnLeft(int speed, int time) {
64
        motor1_set(FWD, speed);
65
        motor2_set(BCK, speed);
66
        delay_ms(time);
67
}
68
*/
69
//Turn Right
70
void turnRight(void) {
71
        motor1_set(BCK, NRML_TURN);
72
        motor2_set(FWD, NRML_TURN);
73
        delay_ms(DELAY_R);
74
}
75
/*
76
void turnRight(int speed) {
77
        motor1_set(BCK, speed);
78
        motor2_set(FWD, speed);
79
        delay_ms(DELAY_R);
80
}
81

82
void turnRight(int speed, int time) {
83
        motor1_set(BCK, speed);
84
        motor2_set(FWD, speed);
85
        delay_ms(time);
86
}*/