Skip to content

Instantly share code, notes, and snippets.

@EvanKrall
EvanKrall / sn65dsi83_i2c.py
Created July 14, 2022 04:24
Script that prints and interprets the i2c registers of the TI SN65DSI83
#!/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 January 8, 2022 08:24
Code that generates a Wordle cheat sheet. https://www.powerlanguage.co.uk/wordle/
aahed
aalii
aargh
aarti
abaca
abaci
aback
abacs
abaft
abaka
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/";
__overlay__ {
vdd_panel: fixedregulator {
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835";
fragment@0 {
target-path = "/";
__overlay__ {
vdd_panel: fixedregulator {
@EvanKrall
EvanKrall / bq25895_i2c.py
Created July 5, 2021 22:18
Tool for reading and interpreting i2c registers from TI bq25895 battery controller
#!/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
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)
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
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>
<?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 November 18, 2016 01:43
keybase/github identity proof

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: