Thanks for the assistance.
No that part is working 100% now (no crashes). I did not connect the slave yet so can not vouch that it is 'actually' working. I will post final TRAINING code on the forum with explanation for other entry level B4A/Things programmers in a few weeks. I found the biggest issue for us beginners is we actually only need the necessary code to get functionality. From then on we can tailor it and learn more.
Like this post of yours.
You can open a SPiDevice with:
Dim spi As JavaObject = jPM.RunMethod("openSpiDevice", Array("SPI0.0")) 'or SPI0.1
'writing:
Dim data() As Byte = Array As Byte(0x0, 0x1, 0x2)
spi.RunMethod("write", Array(data, data.Length))
'reading:
Dim buffer(10) As Byte
spi.RunMethod("read", Array(buffer, buffer.Length))
Native methods documentation:
https://developer.android.com/things/reference/com/google/android/things/pio/SpiDevice.html
This link 'exposed' the commands in .RunMethod("xxx" ..... so it became easier.
The scary part was before I got this read/write code the reference to this
https://developer.android.com/things/sdk/pio/spi.html
was daunting to say the least. BUT it seems as if "SPI0.0" is MODE 0 and .1 is mode 1 ??
My next hurdle is the keyboard input. None of the libs on the forum solve my problem. Note: the application is for industrial use and must thus not allow the operator to 'fool around'. The code will be shared between different apps and should thus be a class or code module. This module must be called from the main 'thread' and just return the result for validation.
Similar to the NumPad example. BUT the value (and the label) must be on the numpad (probably in the FloatLabeledEditText) as it might cover the main screen. At this stage I dont know how the buttons are processed. Lastly, I would prefer if only one instance of the class (Numpad/QWERTYPad) be created as there might be up to 25 numeric inputs during the system setup phase. These popup keyboards will be fixed position and size as the system is developed for 7" Pi screen. (Other screens do not integrate nice with Things)
OK, I noticed that my thread title [Android THINGS] is a bit vague. The idea was to put all my THINGS questions here.
I LOVE THIS PLATFORM.
Adie