Author Topic: Yet Another Webbot LIB question (I2C_Master.h)  (Read 1930 times)

0 Members and 1 Guest are viewing this topic.

Offline AsellithTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Yet Another Webbot LIB question (I2C_Master.h)
« 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?
« Last Edit: January 29, 2010, 05:25:30 PM by Asellith »
Jonathan Bowen
CorSec Engineering
www.corseceng.com

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,072
  • Helpful? 107
Re: Yet Another Webbot LIB question (I2C_Master.h)
« Reply #1 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.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline AsellithTopic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 648
  • Helpful? 9
  • "I'm a leaf on the wind. Watch how I soar"
Re: Yet Another Webbot LIB question (I2C_Master.h)
« Reply #2 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.
Jonathan Bowen
CorSec Engineering
www.corseceng.com

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
3193 Views
Last post March 23, 2010, 03:15:09 PM
by dunk
8 Replies
1716 Views
Last post November 03, 2009, 07:35:14 AM
by Asellith
6 Replies
3175 Views
Last post January 06, 2010, 09:39:25 PM
by Admin
9 Replies
1383 Views
Last post February 14, 2010, 02:21:48 PM
by dellagd


Get Your Ad Here