Author Topic: Converting Arduino I2C code for use with Webbotlib  (Read 1702 times)

0 Members and 1 Guest are viewing this topic.

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Converting Arduino I2C code for use with Webbotlib
« on: August 25, 2010, 04:39:38 PM »
Hi all

I wish to rewrite some Arduino I2C code for use with Webbotlib. The Arduino environment provides a Wire Library that allows you to communicate with I2C / TWI devices. Are there equivalent Webbotlib I2C functions for these Arduino Wire Library Functions:

Wire.begin()
Wire.beginTransmission(address)
Wire.send(address)
Wire.requestFrom(address, count)
Wire.available()
Wire.receive()
Wire.endTransmission()

Thanks
 

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Converting Arduino I2C code for use with Webbotlib
« Reply #1 on: August 25, 2010, 05:59:50 PM »
Did you go through the pdf before posting this question? (my guess is no)

Quote

Standard Function Summary
boolean i2cMasterWriteRegisters(uint8_t deviceAddr, uint8_t startReg,
size_t numBytes, const uint8_t* data)

boolean i2cMasterWriteRegister(uint8_t deviceAddr, uint8_t reg, uint8_t
value)

boolean i2cMasterReadRegisters(uint8_t deviceAddr, uint8_t startReg,
size_t numBytes, uint8_t* data)

i2cSetBitrate(uint16_t bitrateKHz)

boolean i2cMasterSend(uint8_t deviceAddr, size_t length, const uint8_t*
data)

boolean i2cMasterReceive(uint8_t deviceAddr, size_t length, uint8_t *data)

boolean i2cMasterSendWithPrefix(uint8_t deviceAddr, size_t prefixLen,
const uint8_t* prefix, size_t length, const uint8_t* data)

boolean i2cMasterTransfer(uint8_t deviceAddr, size_t wlen, const uint8_t
*wdata, size_t rlen, uint8_t * rdata)

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Converting Arduino I2C code for use with Webbotlib
« Reply #2 on: August 26, 2010, 08:22:36 AM »
@madsci1016

In the light of a fresh day; your guess was correct. It was late, I was tired, I forgot RTFM, yada yada yada....................................

I accept 6 lashes, sorry.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Converting Arduino I2C code for use with Webbotlib
« Reply #3 on: August 26, 2010, 08:48:04 AM »
no worries.

 In my opinion the PDF is very hard to search through. I've been suggesting to Webbot to start online docs for a while now, something more google-able.

Offline InvictaTopic starter

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 1
Re: Converting Arduino I2C code for use with Webbotlib
« Reply #4 on: August 26, 2010, 09:45:14 AM »

Webbot has an online version of the Webbotlib at:

http://webbot.org.uk/WebbotLibDocs/object.jsp?id=0

It is fully google-able at all levels.

Have fun.

p.s. I found it very useful as my computer at work blocks access to the source for Webbotlib.

Offline madsci1016

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
Re: Converting Arduino I2C code for use with Webbotlib
« Reply #5 on: August 26, 2010, 11:35:40 AM »
O I know. When I say a while, I mean a long while.

That's another lashing for not googling btw. :P

 


Get Your Ad Here