This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun readPressure(): Double { | |
val temperature = readTemperature(asFinite = true) | |
val msb = device.read(REGISTER_MSB_PRESSURE, 1U).toInt() | |
val lsb = device.read(REGISTER_LSB_PRESSURE, 1U).toInt() | |
val xlsb = device.read(REGISTER_XLSB_PRESSURE, 1U).toInt() | |
val rawValue = (msb shl 12) + (lsb shl 4) + (xlsb shr 4) | |
var part1 = temperature / 2.0 - 64000.0 | |
var part2 = part1 * part1 * calibration.pressure6 / 32768.0 | |
part2 += part1 * calibration.pressure5 * 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun readPressure(): Double { | |
val temperature = readTemperature(asFinite = true) | |
val msb = device.read(REGISTER_MSB_PRESSURE, 1U).toInt() | |
val lsb = device.read(REGISTER_LSB_PRESSURE, 1U).toInt() | |
val xlsb = device.read(REGISTER_XLSB_PRESSURE, 1U).toInt() | |
val rawValue = (msb shl 12) + (lsb shl 4) + (xlsb shr 4) | |
var part1 = temperature / 2.0 - 64000.0 | |
var part2 = part1 * part1 * calibration.pressure6 / 32768.0 | |
part2 += part1 * calibration.pressure5 * 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
companion object { | |
/** I2C command bit mask */ | |
private const val REGISTER_COMMAND = 0b10000000 | |
/** I2C command to auto increment */ | |
private const val REGISTER_COMMAND_AUTO_INC = 0b00100000 | |
/** I2C address of the TCS3472. */ | |
const val TCS3472_ADDRESS: UByte = 0x29U |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Error: | |
E/AndroidRuntime: FATAL EXCEPTION: CameraThread | |
Process: xxxx, PID: 2634 | |
java.lang.IllegalStateException: buffer has been freed | |
*/ | |
private ImageReader.OnImageAvailableListener onImageAvailableListener = new ImageReader.OnImageAvailableListener() | |
{ | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "MobileGeeks Top 5", | |
"version": "0.1", | |
"manifest_version": 2, | |
"description": "Presents you the latest five article of mobilegeeks.de", | |
"homepage_url": "http://www.mobilegeeks.de", | |
"browser_action": | |
{ | |
"default_icon": "icon48.png", | |
"default_popup": "popup.html" |