Help with Reading Analog Pins

Hi,

I am looking for help writing an app that simply reads DIO pin 0 and displays the analog voltage reading on an iOS platform. Ideally, I would like to create a line graph displaying the real-time voltage readings, however a text label would be a great start. I am new to programming with Xcode, as well as the MetaWear platform. Currently, I have followed the getting started guide and I'm able to successfully run the API test, however I am a bit lost with making this app.

Any help with would be much appreciated.

Thanks,
Matt

Comments

  • How far along are you in the "Getting Started" guide?  You will have a working MetaWear app at the end of guide so I would follow the guide til the end.  When you are done with the guide, you should checkout the iOS docs on the MbientLab website: https://mbientlab.com/iosdocs/, specifically the GPIO section.
  • Eric,

    Thanks for your quick response. I have walked through the getting started guide and I am able to successfully launch the MetaWear App from Xcode. Currently, I am using the example iOS app code to construct an app that just displays the analog value. Attached is what I have so far. The app builds successfully, however I am not able to read the analog pin 0 value. I am not sure if this is because I am missing logic, or if I'm not connecting with the device correctly. 

    I am learning objective c on the fly right now, which is probably the main reason I am having problems. If you could walk me through what I need to have in my code in order to display this pin value, that would be very helpful!

    Thanks,
    Matt

    image

    image
    image
  • If your more comfortable using Javascript there is a cordova plugin that does have support the the GPIO pins with android....IOS will be coming shortly along with an update to the docs with information on how to it.  
  • @Matt

    Unfortunately the screenshots are too small for me to see any code.  

    It seems that you have stopped at part 2 of the guide.  You should go through part 3 of the tutorial so you can become experience with creating a MetaWear app from scratch, especially since you are new to Xcode and objective C.  The iOS app has tons of features that you don't need for simply reading analog data which will only confuse you even further.  
This discussion has been closed.