contrib-drivers | Open source peripheral drivers
kandi X-RAY | contrib-drivers Summary
kandi X-RAY | contrib-drivers Summary
Android Things user-space drivers
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initialize peripheral defaults
- Set the repeat rate on input channels
- Set the maximum number of touch events allowed by the device
- Set the brightness of the led
- Writes the current LED data to the device
- Copy the brightness and color values from the given position to the given destination array
- Enqueues a new print job
- Reads the status of the given printer
- Converts a bitmap image to a LCD screen data
- Sets the specified pixel in the display buffer
- Emits the input events through all registered input channels
- Sends a frame
- Initializes the communication between the device and the device
- Prints a bitmap to the console
- Read position data
- Reads a single end - ended input channel
- Resets the hardware
- Connects to the given I2C port
- Closes the device
- Set the low thresholds for this device
- Start scrolling
- Starts the low access control module
- Read data from the device
- Initializes the I2cDevice
- Connects the data to the device
- Initializes the key code map
contrib-drivers Key Features
contrib-drivers Examples and Code Snippets
Community Discussions
Trending Discussions on contrib-drivers
QUESTION
I am attempting to use SharedPreferences in my Things application, but it always returns 0 for some reason. My setter is getting is logging tht it pushed the right data using the editor, but every read, even after restarting the activity, is always 0. I can't find a reason why Things wouldn't allow use of SharedPreferences, even with a needed permission change, so I'm kind of at a loss. It's obviously my code, but I can't figure out why.
My goal is to use a TextView which is touchable to simply update the date when touched. No buttons, no real interaction, and it's simple and clean. But if SharedPreferences doesn't work, this gets more difficult.
I have been all over different ways of instantiating the SharedPreferences object, in OnCreate, each time I use it to no effect. I have also used a global and local editor to the Activity, to no effect. Writes seem to succeed, but reads always return 0 for getLong(). I switch from apply() to commit() thinking maybe it's just a timing problem. However, exiting and starting the activity again doesn't show a value either, it's still 0.
What is included is the latest based on what I found in the Android documentation based on what I know about Java. The first is just what I believe to be relevant to the question. The second code sample is the full activity.
...ANSWER
Answered 2019-Jun-23 at 15:28The method getLong returns a long, the second parameter to the method you're calling is not a reference to be filled, but the default value to be returned in case the preference is not found.
Your code is simply not checking the return value from shared preferences.
QUESTION
Hi, I'm using:
- The Google Voice Kit for the hardware
- This controler for the Voice Hat (Recognizes perfectly the button and the button LED)
- This app code GitHub Repository
When I start speech recognizerintent it doesn't work and spend me this error:
2018-12-12 14:35:14.064 6546-6546/tck.com.maggie E/SpeechRecognizer: no selected voice recognition service
¿How can i make it work?
Notes: This work perfectly on smartphone, I don´t know if i need implement other driver for de mic and the speaker.
...ANSWER
Answered 2018-Dec-12 at 14:23That means either the user doesn't have a speech recognizer installed at all, or doesn't have one configured to run. There's nothing you can do to fix that, the user has to install one.
QUESTION
I am using Android Things v1.0.1 with the Adafruit Ultimate GPS Breakout Board v3 on the Raspberry Pi 3.
I am trying to display GPS information on screen, specifically sending Lat, Long, Altitude and number of satellites to individual TextView
s on the display but I am struggling.
The NMEA driver I am using is this: Github / Android Things / Contrib Drivers / GPS
And here is my MainActivity
:
ANSWER
Answered 2018-Jun-19 at 17:09Instead use the following in the onLocationChanged()
method:
QUESTION
I am using the Adafruit Ultimate GPS Breakout v3 with Android Things on a raspberry Pi 3. Using the following driver:
https://github.com/androidthings/contrib-drivers/tree/master/gps
I am trying to show the current location in a TextView when a button is pressed. I can log the NMEA messages but get frequent Invalid GSV Messages. It also crashes quite quickly with an ArrayIndexOutOfBoundsException.
Can somebody help please?
Here is the log:
:33:08.782 2536-2536/com.google.android.things.contrib.driver.gps I/zygote: Deoptimizing void com.google.android.things.contrib.driver.gps.NmeaParser.handleSatelliteData(java.lang.String[]) due to block bounds check elimination 06-19 08:33:08.783 2536-2536/com.google.android.things.contrib.driver.gps D/AndroidRuntime: Shutting down VM 06-19 08:33:08.791 2536-2536/com.google.android.things.contrib.driver.gps E/AndroidRuntime: FATAL EXCEPTION: main Process: com.google.android.things.contrib.driver.gps, PID: 2536 java.lang.ArrayIndexOutOfBoundsException: length=19; index=19 at com.google.android.things.contrib.driver.gps.NmeaParser.handleSatelliteData(NmeaParser.java:199) at com.google.android.things.contrib.driver.gps.NmeaParser.processMessageFrame(NmeaParser.java:101) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.handleFrameEnd(NmeaGpsModule.java:206) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:175) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:160) at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:41) at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:138) at com.google.android.things.pio.UartDeviceImpl$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDeviceImpl.java:250) at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:149) at android.os.MessageQueue.dispatchEvents(MessageQueue.java:284) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:325) at android.os.Looper.loop(Looper.java:142) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 06-19 08:33:08.804 2536-2536/com.google.android.things.contrib.driver.gps I/Process: Sending signal. PID: 2536 SIG: 9
UPDATE:
After changing the NmeaParser from 19 to 2 here:
...ANSWER
Answered 2018-Jun-26 at 18:37The NmeaParser
in the GPS driver was incorrectly handling GSV messages that were variable length. We just released a new v1.1 of the driver that fixes the parsing. You should update your app to point to the latest artifact:
QUESTION
I am starting to play with the Adafruit Ultimate GPS Breakout v3 with Android Things v1.0.1 on the Raspberry Pi 3. I am using the code here: Github Contrib Drivers to try and get the GPS co-ordinates but I am not having any luck so I'm hoping somebody could point me in the right direction.
The GpsModuleCallBack() isn't showing anything in the log.
Here is my code:
MainActivity.java
...ANSWER
Answered 2018-Jun-07 at 16:56The Android Things drivers open the Peripheral ports for you, so you should not be accessing the UART directly from PeripheralManager
AND using the driver. Remove the following block of code:
QUESTION
This is my i2c sensor: http://www.mindsensors.com/rpi/76-smartdrive-high-current-motor-controller look in pdf in Documents sessions please
Based on this google guide https://developer.android.com/things/sdk/pio/pio-cli.html What I need to put in XX ZZ YY UU to run motors in determined speed, direction, duration, etc...
e.g.: pio i2c I2C1 0x1B write-reg-buffer 0xXX 0xYY 0xUU 0xZZ
As (in this case) I will use writeRegBuffer() on my android things app to run one, two or both motors in determined spped, direction, duration, etc?
e.g.: I used (via jcenter) this driver in intel edison/android things DP2, but now I want to create an AT driver to use smartdrive in nx pico and rpi 3, because there would be no more mraa:
https://github.com/androidthings/contrib-drivers/issues/70
My questions is: If you see here: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.hpp and especially in this: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.cxx in function
...ANSWER
Answered 2018-Feb-06 at 20:28run motor 1 in direction A pio i2c I2C1 0x1B write-raw 0x46 128 0x05 0x00 0xD1
run motor 1 in direction B pio i2c I2C1 0x1B write-raw 0x46 127 0x05 0x00 0xD1
run motor 2 in direction A pio i2c I2C1 0x1B write-raw 0x4E 128 0x05 0x00 0xD1
run motor 2 in direction B pio i2c I2C1 0x1B write-raw 0x4E 127 0x05 0x00 0xD1
QUESTION
I've noticed in the Android Things contrib-drivers
repo there's a few of these .driver-metadata
files (one in each different driver folder). Does anyone know what they're for?
Example: https://github.com/androidthings/contrib-drivers/blob/master/rainbowhat/.driver-metadata
Thanks!
...ANSWER
Answered 2017-Jan-11 at 08:33It could that Google use a tool to autogenerate the table of available drivers in their README of the repository.
You can see from this commit: https://github.com/androidthings/contrib-drivers/commit/194d09e8f4f0e0d5f8e0eef78ea26bdc8fa4fb5a
That each of the drivers created the type from the .driver-metadata
file:
TYPE="RGB LED strip"
matches the column type
in the README table:
| RGB LED strip |
Further if a .driver-metadata
has another key,value of sample
this is also in the table (and if it doesn't then there is no sample link).
This would mean (Google's side) if a driver was added/updated you would get automatic updates elsewhere.
This is just theoretical, you need a Googler to confirm :-)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install contrib-drivers
You can use contrib-drivers like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the contrib-drivers component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page