Skip to content

Instantly share code, notes, and snippets.

@EvanKrall
EvanKrall / sn65dsi83_i2c.py
Created Jul 14, 2022
Script that prints and interprets the i2c registers of the TI SN65DSI83
View sn65dsi83_i2c.py
#!/usr/bin/python3
from smbus2 import SMBus
import textwrap
import shutil
I2C_ADDRESS = 0x2d
with SMBus(10) as bus:
@EvanKrall
EvanKrall / allwords.txt
Last active Jan 8, 2022
Code that generates a Wordle cheat sheet. https://www.powerlanguage.co.uk/wordle/
View allwords.txt
aahed
aalii
aargh
aarti
abaca
abaci
aback
abacs
abaft
abaka
View pipad_screen.dts
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/";
__overlay__ {
vdd_panel: fixedregulator {
View pipad_screen.dts
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/";
__overlay__ {
vdd_panel: fixedregulator {
@EvanKrall
EvanKrall / bq25895_i2c.py
Created Jul 5, 2021
Tool for reading and interpreting i2c registers from TI bq25895 battery controller
View bq25895_i2c.py
#!/usr/bin/python3
from smbus2 import SMBus
with SMBus(1) as bus:
regs = [bus.read_byte_data(0x6a, addr) for addr in range(0x00, 0x14+1)]
def bit(reg_num, bit_num):
return (regs[reg_num] >> bit_num) & 0x01
View gr3.8.patch
diff --git a/cmake/Modules/GrSwig.cmake b/cmake/Modules/GrSwig.cmake
index 9849447..10d32ec 100644
--- a/cmake/Modules/GrSwig.cmake
+++ b/cmake/Modules/GrSwig.cmake
@@ -114,7 +114,7 @@ macro(GR_SWIG_MAKE name)
endif()
#append additional include directories
- find_package(PythonLibs 2)
+ find_package(PythonLibs 3)
View gist:8370a00cff5487c17ace8ea1b469f34d
meatmanek@juroujin-ubuntu:~/tnc-esp32$ make monitor
Toolchain path: /home/meatmanek/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: esp32-2019r1
Compiler version: 8.2.0
Python requirements from /home/meatmanek/esp/esp-idf/requirements.txt are satisfied.
MONITOR
--- idf_monitor on /dev/ttyUSB0 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
View gist:fdc4e23e3688c809890d908e70737c9c
Python 3.6.0 (default, Jan 13 2017, 20:56:47)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> import tensorflow_probability as tfp
>>> dist1 = tfp.distributions.Beta(tf.ones([1]), tf.ones([1]))
>>> dist2 = tfp.distributions.TransformedDistribution(distribution=dist1, bijector=tfp.bijectors.Affine(shift=tf.ones([1])))
>>> dist2.log_prob(tf.zeros([1]))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
View tonegen.grc
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.9'?>
<flow_graph>
<timestamp>Sun Feb 19 15:32:55 2017</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@EvanKrall
EvanKrall / keybase.md
Created Nov 18, 2016
keybase/github identity proof
View keybase.md

Keybase proof

I hereby claim:

  • I am EvanKrall on github.
  • I am evankrall (https://keybase.io/evankrall) on keybase.
  • I have a public key whose fingerprint is 50E7 67BC 4DE7 C49A 2B8D 5812 F030 BBF3 29C6 54FD

To claim this, I am signing this object: