[Avrora] How to implement a temperature sensor?

Zhifeng Lai zflai at ust.hk
Mon Aug 27 22:12:00 PDT 2007

Dear Benjamin,

Thanks a lot for your information!

After consulting Mica2 datasheet, I find that Mica2 has 51 pins. However,
the number of pin assignments defined in Avrora (ATMega128.java) is 64. I
cannot understand the correspondence between these two. In particular, the
temperature sensor of my evaluated application uses the following pin


However, I could not find pins named "PW4" and "PW6" in Avrora. Could you
help me clarify the bindings? Thank you very much!!!

Best regards,

Yours sincerely,
Zhifeng Lai

-----Original Message-----
From: Benjamin Titzer [mailto:titzer at CS.UCLA.EDU] 
Sent: Tuesday, August 28, 2007 4:28 AM
To: Mailing list for Avrora simulator users and developers.
Cc: 'Zhifeng Lai'
Subject: Re: [Avrora] How to implement a temperature sensor?

You need to look at the constructor code in the LightSensor. It uses the 
names of the pins to figure out where it connects to the MCU. Internally 
there is an API for connecting pins and ADC inputs. The light sensor code 
should be pretty straightforward for explaining this.


Imagination is more important than knowledge.
-- Albert Einstein

On Tue, 28 Aug 2007, Zhifeng Lai wrote:

> Dear all,
> It seems that Avrora does not implement a temperature sensor, I therefore
> want to create it using the LightSensor template and add it to the mica2
> platform. Could you tell me how to correctly connect it to the
> microcontroller. In particular, I want to understand the meaning of this
> statement
>    lightSensor = new LightSensor(amcu, 1, "PC2", "PE5");
> in "avrora.sim.platform.Mica2.addDevices" method. Many thanks!
> Best regards,
> Yours sincerely,
> Zhifeng Lai

More information about the Avrora mailing list