Skip to content

Instantly share code, notes, and snippets.

@codemee
codemee / DHT11_org.cpp
Last active August 11, 2017 01:51
DHT11 library original checksum code
// WRITE TO RIGHT VARS
// as bits[1] and bits[3] are allways zero they are omitted in formulas.
humidity = bits[0];
temperature = bits[2];
uint8_t sum = bits[0] + bits[2];
if (bits[4] != sum) return DHTLIB_ERROR_CHECKSUM;
@codemee
codemee / DHT11.cpp
Created August 11, 2017 01:52
DHT11 modified checksum code
// add bits[1] and bits[3] back to formulas to compute correct checksum.
humidity = bits[0];
temperature = bits[2];
uint8_t sum = bits[0] + bits[1] + bits[2] + bits[3];
if (bits[4] != sum) return DHTLIB_ERROR_CHECKSUM;
@codemee
codemee / cat.py
Last active January 28, 2019 10:51
res = urequests.get( # API 網址
"https://api.openweathermap.org/data/2.5/weather?" +
"q=" + "Taipei" + ",TW" + # 指定城市與國別
"&units=metric&lang=zh_tw&" + # 使用攝氏單位
"appid=" + # 以下填入註冊後取得的 API key
".....................")
/**
* Keyboard Input Library
* Andrew Errity v0.2 (2015-Oct-01)
* GoToLoop v1.0.4 (2015-Oct-22)
*
* https://Forum.Processing.org/two/discussion/13175/
* do-whille-is-not-working-how-it-suppose-to#Item_12
*
* https://GitHub.com/aerrity/Inputs/blob/master/src/Inputs.java
* https://Gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1
@codemee
codemee / var.as
Created May 8, 2022 03:51
asm code generated for var
a:
.long 10
.LC0:
.string "%d"
main:
push rbp
mov rbp, rsp
mov eax, DWORD PTR a[rip]
mov esi, eax
mov edi, OFFSET FLAT:.LC0