Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: roboSonny on December 02, 2010, 03:21:59 PM
-
what is easier to program and work with?an analog or a digital interface sensor?
-
Well it depends on the sensor and the microcontrollers ur using
for an example, if you are using an arduino there is a built-in function for reading analog values and this will make your life easier. On the other hand, if you are using a pic18f4520 you will have to write a function by changing different values of registers and could take you an extra few lines.
In general, the digital sensor is easier to use but it only can provide you with two values (0 and 1). Some times they use different kind of pulses to interpret different data.
On the other hand, the analog sensor will give you only one value that can be interpreted into more detailed information.
It is difficult to answer your question without details, it depends
-
i intend to use axon.
-
Hi,
In general, the digital sensor is easier to use but it only can provide you with two values (0 and 1). Some times they use different kind of pulses to interpret different data.
Like a serial protocol that can give you any number of bits you need.
Analog or digital... Usually you need to use what the sensor provides, so better learn to deal with both.
-
If you are using axon, I would say programming the analog sensor is easier
it is as simple as: analogRead(Sensor);
or you could use it as a condition if(analogRead(Sensor)<30) StopMotor();
for the digital you might have to write a function to interpret its values
but the number of cycles and the time taken could be more in the analog(depending on the type of sensor)
and you should learn how to use both
-
thanks for the help!