When I try to compile the program with this in, I get a syntax error for lines 10 through 14. Is the syntax invalid? I have had similar problems with the GPIO pins in other basics, too.
1 #chip 12f629,4
2 #config MCLRE = ON, INTRC_OSC_NOCLKOUT
3
4 #define STRT GPIO.0
5 #define UP GPIO.1
6 #define DN GPIO.2
7 #define DIR GPIO.4
8 #define MOT GPIO.5
9
10 dir GPIO.0 in
11 dir GPIO.1 in
12 dir GPIO.2 in
13 dir GPIO.4 out
14 dir GPIO.5 out
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I try to compile the program with this in, I get a syntax error for lines 10 through 14. Is the syntax invalid? I have had similar problems with the GPIO pins in other basics, too.
1 #chip 12f629,4
2 #config MCLRE = ON, INTRC_OSC_NOCLKOUT
3
4 #define STRT GPIO.0
5 #define UP GPIO.1
6 #define DN GPIO.2
7 #define DIR GPIO.4
8 #define MOT GPIO.5
9
10 dir GPIO.0 in
11 dir GPIO.1 in
12 dir GPIO.2 in
13 dir GPIO.4 out
14 dir GPIO.5 out
Ouch! bad choice of a constant, #define DIR GPIO.4. Try something else besides DIR. You could also use 'dir GPIO b'110000' if you care to.
Thanks that cured the problem!!