RePhone analog read problem

Moderators: lily.li, violet, jessie, chao.zhang

Post Reply
kaktus.martin
Pre-kindergarten
Pre-kindergarten
Posts: 13
Joined: Tue Dec 29, 2015 9:33 pm

RePhone analog read problem

Post by kaktus.martin » Tue Dec 29, 2015 9:46 pm

Hey guys, I'm programming the rephone with Eclipse for a couple days now.

I have a problem to read a analog value more than 20 times...

I read the value with a function and drop it with the "vm_log_info()" function over USB to the monitor.
But the Monitor stops output value when it arrives line 116...

Cant find the solution for that.

My project is in the attachments

sorry for my bad english, I'm from germany

User avatar
chao.zhang
Kindergarten
Kindergarten
Posts: 81
Joined: Thu Jan 22, 2015 9:55 am

Re: RePhone analog read problem

Post by chao.zhang » Thu Dec 31, 2015 9:35 am

kaktus.martin wrote:Hey guys, I'm programming the rephone with Eclipse for a couple days now.

I have a problem to read a analog value more than 20 times...

I read the value with a function and drop it with the "vm_log_info()" function over USB to the monitor.
But the Monitor stops output value when it arrives line 116...

Cant find the solution for that.

My project is in the attachments

sorry for my bad english, I'm from germany
Hey Kaktus,

Please see the attachment, my colleague has made some changes to your code to solve your problem.

kaktus.martin
Pre-kindergarten
Pre-kindergarten
Posts: 13
Joined: Tue Dec 29, 2015 9:33 pm

Re: RePhone analog read problem

Post by kaktus.martin » Sat Jan 02, 2016 10:16 pm

Thanks a lot. Now it works fine... 8-)

m.duerr
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Sun Jan 24, 2016 5:48 am

Re: RePhone analog read problem

Post by m.duerr » Sat Feb 06, 2016 5:02 am

Hello!

Which pins shown here

http://www.seeedstudio.com/wiki/Xadow_G ... e_Overview

can i use for reading analog values.

Would someone please give me a short example sketch (Arduino IDE) with the analogRead() function?

jianzhang.su
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Wed Apr 08, 2015 1:34 pm

Re: RePhone analog read problem

Post by jianzhang.su » Sun Feb 14, 2016 2:46 pm

Hi, m.duerr
If you have the GSM Breakout, you can reference to this link http://www.seeedstudio.com/wiki/Xadow_GSM_Breakout
for Pin definitions on Arduino IDE. There is example code in Arduino IDE: ..\Arduino_IDE_for_RePhone\workspace\adc_test

m.duerr
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Sun Jan 24, 2016 5:48 am

Re: RePhone analog read problem

Post by m.duerr » Tue Feb 16, 2016 1:58 am

Hi jianzhang.su,

thank your for the advice.

I tested the adc_test.ino script. Connecting A3 (breakout E/1) with 2V8 (C/5) or GND has no effect.

First i tried the adc_test.ino script with the complete assembled RePhone. For a second test i connected the Xadow GSM+BLE only with the Xadow GSM Breakout. Makes no difference.

Other examples like gpio_test_for_breakout_board.ino or pwm_test.ino worked fine.

jinyuan.weng
Pre-kindergarten
Pre-kindergarten
Posts: 33
Joined: Tue Jan 26, 2016 5:17 pm

Re: RePhone analog read problem

Post by jinyuan.weng » Tue Feb 16, 2016 9:59 am

Hi,
I found the github that fix the bug of analog pin mapping, and i checked it is ok.
https://github.com/Seeed-Studio/Arduino_IDE_for_RePhone

m.duerr
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Sun Jan 24, 2016 5:48 am

Re: RePhone analog read problem

Post by m.duerr » Wed Feb 17, 2016 4:15 am

That's it! Thank you!

Four lines of the file "hardware/arduino/mtk/cores/arduino/wiring_analog.c" were updated, like described here.

https://github.com/Seeed-Studio/Arduino ... b4c2e11ebb

I edited these lines of this file inside my IDC folder and it works perfect now.

On the Xadow GSM Breakout are the ADC pins A2 and A3 declared. But belonging to FOUR definitions in wiring_analog.c there must be two more ADC.

By which pins can i connect to them?

dries.deroeck
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Thu Feb 18, 2016 5:33 pm

Re: RePhone analog read problem

Post by dries.deroeck » Thu Feb 18, 2016 5:39 pm

Hi,
After going through the posts in this thread, I'm still confused about connecting an analog sensor to my Xadow GSM breakout board. Is there a working example available I can refer to? (preferably using the arduino IDE)

/edit : I figured this is probably the example that is being referred to: /master/workspace/adc_test/adc_test.ino

If I do get it right, when using pin A3 I can't connect the Xadow Touchscreen, according to http://www.seeedstudio.com/wiki/Xadow_G ... efinitions - is that correct?

m.duerr
Pre-kindergarten
Pre-kindergarten
Posts: 7
Joined: Sun Jan 24, 2016 5:48 am

Re: RePhone analog read problem

Post by m.duerr » Sun Feb 21, 2016 2:25 am

Running the adc_test sketch and connecting A3 (breakout E/1) with 2V8 (C/5) with GND the value goes down from 1023 to zero.
This worked in my case also when the display was connected (but not in use). The touch pad is a i2c device so you should be able to use it simultainiously with the ADC.

Post Reply