zetinal34
Junior Member level 3
Hi all,
I am a newbie here and I am trying to program ATtiny13.
All the system need to do is to delivered the output from the sensor and send it using transmitter.The transmitted duration will be 1 minute continuously, after that the system will pause/sleep for 10 minutes then start to send again.
From what I understand, I have to create a code which functions as below
1. Define one of the port as an input and one as an output.
2. Take the analog resistive output from gas sensor to micro controller input port
3. Send the data from the input port to output port which is connected to transmitter continuously for 1 minute. The system will go to sleep for 10 minutes then redo the sampling.
So my question is,
1. I have to use analog port correct? (in this case ADC0 - ADC3)
for example, I code, DDRB |= (0<<PB4)|(1<<PB3); making ADC2 as an input and ADC3 as an output?
2. How do I read the analog input from this port? what code is it? (I remember that in arduino is using analogRead()). Moreover, if I want to continuously send the data from input port to output port right way without storing data, what should I do?
3. Is it ok to send raw analog data that I receive from sensor right away to the transmitter? Is there any other thing I need to do like analog to digital conversion? (I actually just want the data with minimum noise when it sends out)
4. The sensor provides an analog resistive output, will this affect anything? Can I still read the data and send right away?
Here are the devices I have,
Gas sensor, **broken link removed**
Micro controller, http://www.atmel.com/devices/attiny13.aspx?tab=overview
Transmitter, http://www.sparkfun.com/products/10534
Please kindly advice,
Thank you everyone )
I am a newbie here and I am trying to program ATtiny13.
All the system need to do is to delivered the output from the sensor and send it using transmitter.The transmitted duration will be 1 minute continuously, after that the system will pause/sleep for 10 minutes then start to send again.
From what I understand, I have to create a code which functions as below
1. Define one of the port as an input and one as an output.
2. Take the analog resistive output from gas sensor to micro controller input port
3. Send the data from the input port to output port which is connected to transmitter continuously for 1 minute. The system will go to sleep for 10 minutes then redo the sampling.
So my question is,
1. I have to use analog port correct? (in this case ADC0 - ADC3)
for example, I code, DDRB |= (0<<PB4)|(1<<PB3); making ADC2 as an input and ADC3 as an output?
2. How do I read the analog input from this port? what code is it? (I remember that in arduino is using analogRead()). Moreover, if I want to continuously send the data from input port to output port right way without storing data, what should I do?
3. Is it ok to send raw analog data that I receive from sensor right away to the transmitter? Is there any other thing I need to do like analog to digital conversion? (I actually just want the data with minimum noise when it sends out)
4. The sensor provides an analog resistive output, will this affect anything? Can I still read the data and send right away?
Here are the devices I have,
Gas sensor, **broken link removed**
Micro controller, http://www.atmel.com/devices/attiny13.aspx?tab=overview
Transmitter, http://www.sparkfun.com/products/10534
Please kindly advice,
Thank you everyone )