Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing errors

  • Loading branch information...
commit c0963b3499da1469372ecfcd77b346ea98e4a253 1 parent 47a4b4f
@MichaelStevens MichaelStevens authored
Showing with 11 additions and 9 deletions.
  1. +3 −3 Makefile
  2. +2 −2 bbio.c
  3. +6 −4 main.cpp
View
6 Makefile
@@ -3,14 +3,14 @@ OBJ_DIR=obj/Debug
BBLIB=$(BIN_DIR)/bblib
MAIN.O=$(OBJ_DIR)/main.o
BBIO.O=$(OBJ_DIR)/bbio.o
-G++=arm-linux-gnueabi-g++
+Gpp=arm-linux-gnueabi-g++
GCC=arm-linux-gnueabi-gcc
$(BBLIB): $(MAIN.O) $(BBIO.O)
- $(G++) $(MAIN.O) $(BBIO.O) -o bin/Debug/bblib
+ $(Gpp) $(MAIN.O) $(BBIO.O) -o bin/Debug/bblib
$(MAIN.O): main.cpp bbio.h
- $(G++) -W -Wall -c main.cpp -o $(MAIN.O)
+ $(Gpp) -W -Wall -c main.cpp -o $(MAIN.O)
$(BBIO.O): bbio.c bbio.h gperf_pinMap.h
$(GCC) -Wall -c bbio.c -o $(BBIO.O)
View
4 bbio.c
@@ -13,7 +13,7 @@ int checkPin(struct pin *p, int mode) {
if(!p) return 0;
switch(mode){
case 0:
- if(p->pgio != -1) return 1;
+ if(p->gpio != -1) return 1;
break;
case 1:
if(p->mux != NULL) return 1;
@@ -30,7 +30,7 @@ int checkPin(struct pin *p, int mode) {
void digitalWrite(const char *pin, int value) {
- struct pin *p = getPin(pin, strlen(pin))
+ struct pin *p = getPin(pin, strlen(pin));
if(checkPin(p, 0) == 0) {
printf("Error: %s is not a digital pin", pin);
View
10 main.cpp
@@ -41,15 +41,17 @@ int main() {
cout << "Hello world!" << endl;
//pinDemo();
- char *pwm = "P9_14";
- muxPin(pwm, 6);
+ char *pwm = "P9_16";
+ muxPin(pwm, 6);
+ cout<<"0%"<<endl;
+ sleep(1);
for(int i=0;i<10;i++) {
- pwmWrite(pwm, 100, (i+1)*10, 1);
+ pwmWrite(pwm, 200, (i+1)*10, 1);
cout<<(i+1)*10<<"%"<<endl;
sleep(1);
}
for(int i=0;i<10;i++) {
- pwmWrite(pwm, 100, (10-i)*10, 1);
+ pwmWrite(pwm, 200, (10-i)*10, 1);
cout<<(10-i)*10<<"%"<<endl;
sleep(1);
}
Please sign in to comment.
Something went wrong with that request. Please try again.