-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmotors
More file actions
56 lines (51 loc) · 742 Bytes
/
Copy pathmotors
File metadata and controls
56 lines (51 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <htc.h>
#if defined(WDTE_OFF)
__CONFIG(WDTE_OFF & LVP_OFF);
#elif defined (WDTDIS)
__CONFIG(WDTDIS & LVPDIS);
#endif
#define _XTAL_FREQ 4000000
void main(void) {
TRISC0=0;
TRISC1=0;
TRISC2=0;
TRISC3=0;
TRISD0=1;
TRISD1=1;
TRISB1=1;
TRISB2=1;
while (1)
{ if(RD0==0)
{RC0=1;
RC1=1;}
else
if(RD0==1)
{RC0=0;
RC1=0;
}
if(RD1==0)
{RC3=1;
RC2=1;}
else
if(RD1==1)
{RC3=0;
RC2=0;
}
if(RB1==0)
{RC0=1;
RC1=0;}
else
if(RB1==1)
{RC0=0;
RC1=0;
}
if(RB2==0)
{RC0=0;
RC1=0;}
else
if(RB2==1)
{RC0=0;
RC1=0;
}
}
}