In this part 2, the code of the app is based on the same idea, but this time using android API bulktranfer methods just to use the SPI in the CP2130.
The APP
Like the first app, it is created using Android Studio. Minimum requierements are a hardware that support usb otg and software minimum icecream sandwitch 4.0.3.
Again, android ask for launching the app as soon as the CP2130 is connected to the android device, and detected. This time, when the app starts, it makes the usb connection directly with the CP2130.
There is one button to start/stop the SPI communications with the ADC Si9702. The app reads two channels of the ADC, CH0 for the potentiometer, and CH1 for the MCP9701 temperature sensor.
For the potentiometer there is a progress bar that shows from 0% to 100% the position of the wiper. And for the MCP9701 there is a TextView showing the temperature in celsius degrees in format XX.XºC.
Communications (bulktranfer transactions), as recommended, run in a diferent thread in order not to block the user interface.
See the pictures and video.
Also if you want to checkit, here is the .apk file to instal it:
app-release-unsigned-part2.apk
I would really appreciate if you try it and give your feedback.
I hope you really enjoy this post,
Miguel
Top Comments