Read analog PIN (A)


#1

Hello,
I have the beta version for Linux 64 and when I try to read an analog Pin of arduino board I get no value. When I look the code generated I think something is wrong.
It appears this code
if(((analogRead(A0+0))==(0))){
And I think it should be
if(((analogRead(A0))==(0))){
Am I wrong???

Thanks


#2

Hi,

I think this is a matter of writing, the generated code for this part are same on both the linux version mBlock and linux version mBlock.

Do you have the same problem with the same code while using the Windows version mBlock software? And can you get a value when you read the same analog pin using the Arduino software?


#3

Hello,
I hadn’t got a Windows computer till now. I agree, the code is the same.
I have tried with an arduino uno and mega in different computers and I have problems with both in Linux.
Any read pin (even digital or analogic) has no value (always 0). Same program in Windows works.

Thank you


#4

I see, this should be a bug on the linux version mBlock software since it is an experimental version.
I will provided feedback to the software team.


#5

Ok.
It would be great if they fix it. For more information I have tried with an Mbot and all the sensors work well. The problem is only with arduino boards (Uno and Mega tried)

Thanks


#6

Good to hear that!
Yes, our engineer has recorded this issue. They will fix it when there is new version for it.