# ADC driver for app control (Legato 16.07, WP85xx)?

**URL:** <https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199>\
**Category:** Uncategorized\
**Created:** [October 21, 2016, 5:47am UTC](https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199 "2016-10-21T05:47:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hlro1](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hlro1](https://forum.legato.io/u/hlro1)\
**Post date:** [October 21, 2016, 5:47am UTC](https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199/1 "2016-10-21T05:47:39Z")

</div>

Hi there,

How can we read the ADC within the app? At present all the documentation points to issuing

cm adc read EXT\_ADC1

at the shell to do so. I would very much prefer to do it in C.

Also, I keep getting Read EXT\_ADC\<1:2\> failed when issuing this command. Listing the ADCs is fine. Any reason for the failure?

Best regards,

Royan

---

<div class="post-metadata">

**Author:** ![ashiot](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@ashiot](https://forum.legato.io/u/ashiot)\
**Post date:** [October 21, 2016, 5:51am UTC](https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199/2 "2016-10-21T05:51:41Z")

</div>

you can look at the adc tutorial at

[https://github.com/mangOH/mangOH/tree/master/samples/tutorials/hardwareInterfaces/adc/NoiseSensor](https://github.com/mangOH/mangOH/tree/master/samples/tutorials/hardwareInterfaces/adc/NoiseSensor)

cheers,  
Ashish

---

<div class="post-metadata">

**Author:** ![hlro1](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@hlro1](https://forum.legato.io/u/hlro1)\
**Post date:** [October 21, 2016, 1:16pm UTC](https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199/3 "2016-10-21T13:16:24Z")

</div>

Hi Ashish,

Thanks a lot for the link. I have tried it but ended up with the following error:

Jan 6 00:26:52 swi-mdm9x15 user.err Legato: =ERR= | serviceDirectory[594]/serviceDirectory\_exe T=main | serviceDirectory.c DispatchToServer() 713 | Client (uid 1019 ‘appnoiseData’, pid 854) disagrees with server (uid 0 ‘root’, pid 647) on protocol ID of service 'noiseDat  
Jan 6 00:26:52 swi-mdm9x15 user.emerg Legato: _EMR_ | noiseData[854]/framework T=main | messagingSession.c ReceiveSessionOpenResponse() 725 | Unexpected server response: -6 (LE\_FAULT).  
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | proc.c proc\_SigChildHandler() 1354 | Process ‘noiseData’ (PID: 854) has exited with exit code 1.  
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | proc.c GetFaultAction() 1151 | No fault action specified for process ‘noiseData’. Assuming ‘ignore’.  
Jan 6 00:26:52 swi-mdm9x15 user.warn Legato: -WRN- | supervisor[569]/supervisor T=main | app.c app\_SigChildHandler() 1641 | Process ‘noiseData’ in app ‘noiseData’ faulted: Ignored.  
Jan 6 00:26:52 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | app.c app\_SigChildHandler() 1694 | app ‘noiseData’ has stopped.  
Jan 6 00:26:53 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | sandbox.c sandbox\_Remove() 1450 | ‘noiseData’ sandbox removed.  
Jan 6 00:26:53 swi-mdm9x15 user.info Legato: INFO | supervisor[569]/supervisor T=main | supervisor.c DeleteAppObj() 575 | Application ‘noiseData’ has stopped.  
Jan 6 00:26:55 swi-mdm9x15 user.err Legato: =ERR= | appCtrl[890]/framework T=main | cgroups.c OpenCgrpFile() 167 | Could not open file ‘/sys/fs/cgroup/freezer/noiseData/tasks’. No such file or directory.

Wonder what is causing this?

Best regards,

Royan

---

<div class="post-metadata">

**Author:** ![ashiot](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@ashiot](https://forum.legato.io/u/ashiot)\
**Post date:** [October 21, 2016, 5:38pm UTC](https://forum.legato.io/t/adc-driver-for-app-control-legato-16-07-wp85xx/2199/4 "2016-10-21T17:38:48Z")

</div>

Can you inform me of the following:  
a. Firmware/legato version of your module  
b. Legato on your host  
regards,  
ashish

ps: you can move this question to the mangoh forum: [forum.mangoh.io](http://forum.mangoh.io)
