This file contains hidden or 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
SELECT | |
file.project, | |
count(distinct details.system.release) as distinct_setups, | |
count(*) as num_downloads | |
FROM `the-psf.pypi.downloads2017*` | |
WHERE LOWER(file.project) in ('cpickle','json', 'sqlite3','sqlite', 'marshal','math','os','pickle','platform','socket','stat','string','sys','tempfile') | |
and details.installer.name = 'pip' | |
GROUP BY file.project | |
ORDER BY num_downloads desc |
This file contains hidden or 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
regs::GPIO().outset.set_pins(1) // Make the GPIO pin 1 go high |
This file contains hidden or 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
TIMEOUT = 100 |
This file contains hidden or 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
ioregs! (GPIO @ 0x50000000 = { //! power management unit | |
0x504 => reg32 out { 31..0 => pins }, // write to gpio | |
0x508 => reg32 outset { 31..0 => pins }, // set individual out pins to high | |
0x50c => reg32 outclr { 31..0 => pins } , // set individual out pins to low | |
0x510 => reg32 in { 31..0 => pins } , // read pin values | |
0x514 => reg32 dir { 31..0 => pins } , // set direction of all pins (1=output, 0=input) | |
0x518 => reg32 dirset { 31..0 => pins } , // set individual pins to output | |
0x51c => reg32 dirclr { 31..0 => pins } , // set individual pins to input | |
0x700 => reg32 pin_config[32] { | |
0 => dir, |
This file contains hidden or 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
from microbit import i2c, sleep | |
CMD_ON = 175 | |
CMD_OFF = 174 | |
CMD_CHARGE_PUMP_SET = 141 | |
CMD_SET_ROW = 176 | |
CMD_TOP_TO_BOTTOM = 200 | |
CMD_LEFT_TO_RIGHT = 161 | |
CMD_SET_ADDR_MODE = 32 |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import smbus2 | |
import time | |
import numpy as np | |
import cv2 | |
from collections import deque | |
class Display: |
This file contains hidden or 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
<style>.ww{word-break: break-all;}</style> | |
<body> | |
<div id="x" class=""></div> | |
<script> | |
function n_rand(n){ | |
var str = ""; | |
while (str.length < n) { |
This file contains hidden or 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
>>> from machine import * | |
>>> from pyb import * | |
>>> iic = I2C(Pin(2), Pin(0)) | |
>>> iic.writeto(60, b'\x80\xAF') # Turn display on | |
>>> iic.writeto(60, b'\x80\x8D\x80\x14') # Set the voltage pump |
This file contains hidden or 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
>>> from machine import * | |
>>> from pyb import * | |
>>> iic = I2C(Pin(2), Pin(0)) | |
>>> iic.writeto(0x7A, 0xAF) | |
>>> iic.writeto(0x7A, 0xA7) |
This file contains hidden or 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
>>> from machine import * | |
>>> from pyb import * | |
>>> iic = I2C(Pin(2), Pin(0)) | |
>>> iic.writeto(0x78, 0xAF) | |
>>> iic.writeto(0x78, 0xA7) |