problem of getting the right data on analog input port MOD-IO with Duinomite

Started by plaiteux, November 02, 2012, 12:32:31 AM

Previous topic - Next topic

plaiteux

Hello,

I recently bough a Duinomite Mega and a MOD-IO board.

When I execute the short program from the manual to aquire data from the analog input port, it works fine if it is only for one input. But when I start to want to read on the forth input then I have a strange thing. No problem to get the first 8 bits but there is something wrong with the two others (9&10).  :-[
If I read data on AIN1, the first 8 bit are vailable at &H30 but the two last are available at &H31
If I read data on AIN2, the first 8 bit are vailable at &H31 but the two last are available at &H32
If I read data on AIN3, the first 8 bit are vailable at &H32 but the two last are available at &H33
If I read data on AIN4, the first 8 bit are vailable at &H33 but the two last are available at &H34

If I neutralise ( by putting rem at the beginning) 3 of the lines  reading the differnet adresses, It works well without having to make tricky things. :(