Skip to content

Instantly share code, notes, and snippets.

@jadonk
jadonk / grove-probe
Last active October 27, 2020 16:42
#!/usr/bin/env perl
my $devices = `i2cdetect -y -r 2`;
#print $devices;
my @lines = split /\n/, $devices;
foreach my $line ( @lines ) {
next if $line =~ /^\s/; # skip lines starting with whitespace
$line =~ s/\d\d\:\s*//; # remove 2 digit indexes
#print $line , "\n";
my @entries = split /\s/, $line;
foreach my $entry ( @entries ) {
@walchko
walchko / mjpeg2.py
Last active August 21, 2022 23:31
a better mjpeg streamer in python using opencv 3.x
#!/usr/bin/env python3
# MIT License
# (c) 2017 Kevin J. Walchko
#
# Updated 16 Mar 2020: Python 3.7.5 Ubuntu 19.10
# Desktop, wired interface is enp2s0
# Raspberry Pi: wlan0
# Ideally, this should be fixed, it is hard coded right now
@ravikp7
ravikp7 / output
Created June 4, 2017 05:32
Schemapack encoding doesn't work for array of more than 9 objects.
ravi@ravi-Lenovo-G50-45:~/beagle-js$ node serializer-test.js
undefined:3
var ref1=json;var ref2=ref1['a'];var ref3=ref2[0];var ref4=ref2[1];var ref5=ref2[10];var ref6=ref2[2];var ref7=ref2[3];var ref8=re
f2[4];var ref9=ref2[5];var ref10=ref2[6];var ref11=ref2[7];var ref12=ref2[8];var byteC=0;byteC+=1;byteC+=1;byteC+=bag.dynamicByteC
ounts['string'](ref5['pad']);byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=1;byteC+=bag.getVarUIntByteLength(ref2.l
ength);for (var j2=10;j2<ref2.length;j2++) { var ref13xn=ref2[j2];byteC+=1;}var wBuffer=bag.allocUnsafe(byteC);bag.byteOffset=0;if
(typeof(ref3['a']) !== 'number'||ref3['a']<0||ref3['a']>255){bag.throwTypeError(ref3['a'],'number',0,255,'uint8');}bag.byteOffset
= wBuffer.writeUInt8(ref3['a'], bag.byteOffset, true);if (typeof(ref4['b']) !== 'number'||ref4['b']<0||ref4['b']>255){bag.throwTy
peError(ref4['b'],'number',0,255,'uint8');}bag.byteOffset = wBuffer.writeUInt8(ref4['b'], bag.byteOffset, true);if (typeof(ref5['p
ad']) !== 'string'){bag.throwTypeE
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@patterns
patterns / beagleboneblack.txt
Created February 25, 2017 12:53
Build Bitcoin full node on BeagleBone Black
#!/bin/sh
# Download latest Debian image for microSD from https://beagleboard.org/latest-images
# List drives before inserting microSD
df -h
# Insert microSD, then Look for the newly listed SD drive (disk2s1)
df -h
# Unmount the microSD
@jadonk
jadonk / BB-SPIDEV1B-00A0.dts
Created March 17, 2016 20:57
BrainPad FBTFT display
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-green";
@pdp7
pdp7 / BBG-ADXL345.md
Last active September 8, 2019 06:16
BeagleBone Green: ADXL345 Grove Acceleromter sensor
@pdp7
pdp7 / bbg-th02-sensor.md
Last active March 16, 2016 13:24
BeagleBone Green: TH02 sensor
root@beaglebone:~# echo si7005 0x40 > /sys/class/i2c-adapter/i2c-2/new_device 

root@beaglebone:~# dmesg |tail -1
[ 5496.770283] i2c i2c-2: new_device: Instantiated device si7005 at 0x40

root@beaglebone:~# find /sys/ -type f |grep iio |grep -v /power/ | xargs more
::::::::::::::
/sys/bus/iio/drivers_autoprobe
::::::::::::::
@pdp7
pdp7 / adc121c021.diff
Last active April 1, 2016 16:33
Android has driver for the ADC in the SeeedStudio Grove ADC: android / kernel / bcm / drivers / power / adc121c021_driver.c
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 1ddd13c..b9d7919 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -495,6 +495,13 @@ config CHARGER_RT9455
help
Say Y to enable support for Richtek RT9455 battery charger.
+config MONITOR_ADC121C021_I2C
+ tristate "ADC121C021 Battery Monitor"