Society of Robots - Robot Forum
Software => Software => Topic started by: Asellith on January 29, 2010, 05:21:24 PM
-
Ok working on my comand unit now to test sending commands to my newly compiled but untested module code. I'm trying to send a command to the unit here is what I have so far.
uint8_t sonar_addr = 0xBB;
uint8_t SET_SENSOR_TYPE_EZ1[2] = (0x03,0x01);
boolean ok = i2cMasterSend(sonar_addr, 2, SET_SENSOR_TYPE_EZ1);
ok my questions:
Whats an uint8_t? I am assuming its an unsigned 8 bit length integer but whats the t for?
the second line gets a compile error
../ExMOD.c:37: error: invalid initializer
The function statement calls for const uint8_t* data
The const and the * are throwing me. is this a constant pointer that needs to be setup where I store the data? If so how do I do that?
Thanks
EDIT
Ok I need to learn to program one problem solved. here is my correcly compiled code
uint8_t sonar_addr = 0xBB;
uint8_t SET_SENSOR_TYPE_EZ1[2] = {0x03,0x01};
boolean ok = i2cMasterSend(sonar_addr, 2, SET_SENSOR_TYPE_EZ1);
Got to learn how to declare an array
However I now get this error
d:/winavr-20090313/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: cannot find -lWebbot-ATMega640
ideas?
-
Have you included the libraries as discussed in the 'Getting Started with AVRStudio' section of the manual?
The 'const' is there to indicate that the routine you are calling will not change the contents of the array.
-
ok I see the problem. I am using dropbox but evidently it doesn't do what i thought. So it screwed up something between my computers. I almost lost the days works. however after working on the file on two different computers It messed up where the library was pointed as they are not both running the same OS even though dropbox has the files in the documents folders the windows 7 machine has a slightly different path structure. Thanks again webbot.