RePhone analog read problem

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
Unbenannt.png (152 KB)

Hey Kaktus,

Please see the attachment, my colleague has made some changes to your code to solve your problem.
Hallo_Welt_v1.1.rar (131 KB)

Thanks a lot. Now it works fine… :sunglasses:


Which pins shown here … e_Overview

can i use for reading analog values.

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

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


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.

I found the github that fix the bug of analog pin mapping, and i checked it is ok.

That’s it! Thank you!

Four lines of the file “hardware/arduino/mtk/cores/arduino/wiring_analog.c” were updated, like described here. … 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?

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 … efinitions - is that correct?

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.