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
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 |
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
/** | |
* 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 |
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
res = urequests.get( # API 網址 | |
"https://api.openweathermap.org/data/2.5/weather?" + | |
"q=" + "Taipei" + ",TW" + # 指定城市與國別 | |
"&units=metric&lang=zh_tw&" + # 使用攝氏單位 | |
"appid=" + # 以下填入註冊後取得的 API key | |
".....................") |
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
// 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; |
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
// 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; |