- https://slide.rabbit-shocker.org/authors/hasumikin/RubyKaigiTakeout2021/
- https://github.com/picoruby/prk_firmware
- https://speakerdeck.com/kakutani/diykeyboard-is-ruby?slide=29
- 初心者はLEDは後回しにしたほうが
import pyxel | |
class App: | |
def __init__(self): | |
pyxel.init(160, 120, title="hello") | |
pyxel.run(self.update, self.draw) | |
def update(self): | |
pass |
from queue import Queue | |
import threading | |
import time | |
from gpiozero import Button | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
import sys | |
from icecream import ic | |
PIN_SW_NO1 = 5 |
from queue import Queue | |
import threading | |
import time | |
from gpiozero import LED | |
from gpiozero.pins.pigpio import PiGPIOFactory | |
import sys | |
from icecream import ic | |
PIN_LED_NO1 = 16 | |
PIN_LED_NO2 = 20 |
import picamera | |
import discord | |
import asyncio | |
client = discord.Client() | |
x = 0 | |
#ここをご自身の環境に書き換えてください。 | |
chid = ここにチャンネルIDを貼り付け | |
token = "ここにBOTトークンを貼り付け" |
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(16, GPIO.OUT) | |
pwm = GPIO.PWM(16, 100) | |
pwm.start(5) | |
while True: | |
sleep(0.1) | |
#include <M5Stack.h> | |
#define NBIN 30 | |
static int16_t s_ring[NBIN]; | |
static int s_curr; | |
static int16_t s_bg; | |
static int s_delay = 20000; | |
static unsigned long s_tm; | |
void setup() { |
def readfile( fn ) | |
fp = open( fn ) | |
str = "" | |
fp.each_line.map { |ln| | |
ln.split(",").map { |n| n.to_i } | |
} | |
end | |
def solveNumPlace(problem, stack) | |
memory = {candidate: [], row: 0, col: 0, problem: []} |
require "curses" | |
def finishRestart(win, limit) | |
str = win.getch | |
if (str == 'r') | |
win.clear | |
win.refresh | |
timer_start(limit) | |
elsif (str == 'q') | |
win.close |