Compass Heading Compiler Error


hey guys, needed code take heading , print out cardinal direction. "error: expected unqualified-id before '[' tokenbad error line: -2" ide compiler. suggestions? have gps feed in course , print out direction 1 day.
code: [select]

char[] getdirection(unsigned long h){
 if(h>337.5){
   return "n";
 else if(h>292.5)
   return "nw";
 else if(h>247.5)
   return "w";
 else if(h>202.5)
   return "sw";
 else if(h>157.5)
   return "s";
 else if(h>112.5)
   return "se";
 else if(h>67.5)
   return "e";
 else if(h>22.5)
   return "ne";
 else
   return "n";
}

thanks,
-r

change:
char[] getdirection(unsigned long h){
to...
char *getdirection(unsigned long h){


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Compass Heading Compiler Error


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums