How to use the ADC in Legato app?


#1

Cross-post from the mangOH forum - as I think this is generic to Legato, and not specific to mangOH?


#2

As described in the cross-post, I got it to build - but it doesn’t work.

:frowning:

le_adc_ReadValue() returns -6; which is LE_FAULT = “Unspecified internal error

Any ideas :question:


#3

Awnell,

Please, upgrade your system with last version of legato (16.04.0) and use cm adc read EXT_ADC1 or 2. It work.

Best regards,
Sylvain


#4

Thanks.

Can you confirm that what I’ve done is correct - so it’s just the update that I need?

How do I check the current Legato version on the target?


#5

But that’s a command-line tool, isn’t it :question:

What I need is to read the ADC from within an application.


#6

OK - I found it: legato.io/legato-docs/latest/too … egato.html


#7

Yes, it is:

So if this command fails, I guess that explains why my app also failed?

Note that the documentation is incomplete: legato.io/legato-docs/latest/too … get_cm_adc - it refers to “the names returned” but doesn’t say how to get them returned!


#8

after doing the update, the cm adc read command does now seem to work;
but the cm adc list is broken!

There doesn’t seem to be a package yet for Developer Studio - so my app refuses to start because its Legato version doesn’t match the version running on the target :exclamation:

:angry:


#9

I had Developer Studio 4.0; it needs to be updated to 4.1 - then a Legato 16.4.0 Package becomes available to install …


#10

By George - I do believe we’ve got it :exclamation:

:smiley:


#11

So to get this working required:

  1. Firmware 16.04.0 - which was only released on 9 June;
  2. Developer Studio 4.1 - dated 8 June.

Does this mean that I’m the first (outside SiWi) to get this working?! :open_mouth: