Society of Robots - Robot Forum

Software => Software => Topic started by: Asellith on January 29, 2010, 05:21:24 PM

Title: Yet Another Webbot LIB question (I2C_Master.h)
Post 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.

Code: [Select]
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

Code: [Select]
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?
Title: Re: Yet Another Webbot LIB question (I2C_Master.h)
Post by: Webbot on January 29, 2010, 07:26:05 PM
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.
Title: Re: Yet Another Webbot LIB question (I2C_Master.h)
Post by: Asellith on January 29, 2010, 08:13:04 PM
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.