[Tinyos-help] ADC&MDA300
Christopher Leung
christopher.leung at mail.mcgill.ca
Mon Jun 23 09:30:52 PDT 2008
You also need to use the interface Resource from the Atm128I2CMasterC component.
Here are the steps you will need to do: Resource.request, wait for Resource.granted, I2C.write, wait for I2C.writeDone, I2C.read, wait for I2C.readDone, Resource.release. It's important that you release the I2C resource especially if you have other components relying on it.
Chris
________________________________
From: Antonio Prados Vilchez [mailto:Centag71 at acciona.es]
Sent: Mon 6/23/2008 5:16 AM
To: Christopher Leung; tinyos-help at millennium.berkeley.edu
Subject: RE: [Tinyos-help] ADC&MDA300
Thanks for your help, Christopher.
Now I'm trying to use the I2C interface, as you said, but it doesn´t work. I get a lot of compiling errors in the I2CPacket and Atm128I2CMasterC files, so I think it's because of the instantiation. Am I doing it right? Should I upgrade my TinyOS files to a newer version? The way I instantiate these interfaces and components is:
-----------
implementation
{
...
components new Atm128I2CMasterC();
...
App.I2CPacket -> Atm128I2CMasterC;
}
-----------
module SensorToRadioC
{
uses
{
...
interface I2CPacket<TI2CBasicAddr>;
}
}
-----------
Thanks in advance
More information about the Tinyos-help
mailing list