Skip to content

Instantly share code, notes, and snippets.

#include <pgmspace.h>
// HelloWorld.png
// https://lang-ship.com/tools/image2data/
const uint16_t imgWidth = 69;
const uint16_t imgHeight = 31;
// RGB565 Dump(big endian)
const unsigned short img[2139] PROGMEM = {
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<title>ぽる研</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
// +-\/-+
// VDD 1| |8 GND
// LUT0-OUT PA6 2| |7 PA3
// PA7 3| |6 PA0 ~RESET UPDI
// LUT0-IN1 AIN1 PA1 4| |5 PA2
// +----+
// 4番ピンに入力されるクロックを(AVR本体のクロックとは関係なく)2番ピンから出力する。4番ピンのクロック停止を検出すると、2番ピンから5MHzが出力され、同時に5番ピンがHighになる。
// 入力2.5MHz~5MHzでうまくいった。それより外は知らない。ADCのCR時定数によって下限は2MHz、論理回路の遅延によって上限は10MHzくらいだと思う。
#ifndef __AVR_ATtiny202__
@pol8139
pol8139 / ONKYO2YAMAHA.ino
Last active April 29, 2020 10:39
ONKYO TX-L50 のリモコンの信号を受信し、 YAMAHA CDX-620 の信号に変換して送信する。Arduino Unoで動作確認済 https://twitter.com/PoL8139/status/1220927913140211714
#include <IRremote.h>
int recvPin = 11;
// transmit pin = 3
IRrecv irrecv(recvPin);
IRsend irsend;
uint32_t button_map[2][3] {
{0x4B983AC5, 0x4B4009F6, 0x4B40F10E},
{0x5EA110EF, 0x5EA1D02F, 0x5EA150AF}
#include <WiiChuck.h>
#define BUF_SIZE 6
Accessory nunchuck1;
uint8_t buf[BUF_SIZE];
//char buf00[8] = {};
//char buf01[8] = {};
//char buf02[8] = {};
//char buf03[8] = {};
# $Id: avrdude.conf.in 1236 2013-09-16 19:40:15Z joerg_wunsch $ -*- text -*-
#
# AVRDUDE Configuration File
#
# This file contains configuration data used by AVRDUDE which describes
# the programming hardware pinouts and also provides part definitions.
# AVRDUDE's "-C" command line option specifies the location of the
# configuration file. The "-c" option names the programmer configuration
# which must match one of the entry's "id" parameter. The "-p" option
# identifies which part AVRDUDE is going to be programming and must match
@pol8139
pol8139 / checkvm.bat
Created March 4, 2019 16:15
WindowsホストでVirtualBoxのゲストOSがネットワーク接続できなくなったときにネットワークアダプタの接続解除・再接続をする(とうちの環境ではうまくいく)。管理者権限で一定期間ごとに実行(VMも管理者権限で起動されてる必要あり)。
@echo off
ping -n 1 192.168.vm.ipaddress | find "TTL" > NUL
if not ERRORLEVEL 1 goto end
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "vmname" setlinkstate1 off
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "vmname" setlinkstate1 on
:end
@pol8139
pol8139 / Dualshock4_leonardo_pad_win.xml
Created July 16, 2018 16:35
gimxで自作DIVAアケコンを使用するときのコンフィグファイル(Windows用)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<controller id="1" dpi="0" type="DS4">
<configuration id="1">
<trigger type="" id="" name="" button_id="" switch_back="no" delay="0"/>
<mouse_options_list/>
<intensity_list/>
<button_map>
<button id="abs_axis_17" label="">
<device type="joystick" id="0" name="PS4 Controller"/>
@pol8139
pol8139 / Dualshock4_leonardo.xml
Last active October 23, 2017 14:10
gimxで自作DIVAアケコンを使用するときのコンフィグファイル
<?xml version="1.0" encoding="UTF-8"?>
<root>
<controller id="1" dpi="0" type="DS4">
<configuration id="1">
<trigger type="" id="" name="" button_id="" switch_back="no" delay="0"/>
<mouse_options_list/>
<intensity_list/>
<button_map>
<button id="abs_axis_10" label="">
<device type="joystick" id="0" name="Sony Computer Entertainment Wireless Controller"/>
@pol8139
pol8139 / main_CapSenseP4.c
Created August 16, 2017 12:07
PSoC4でCapSense(CapSenseCSDではない)で端子触ってるかどうか見てUARTで送信するコード
#include <project.h>
#include <stdlib.h>
#define STR_LENGTH 256
#define TOUCH_NUM CapSenseP4_TOTAL_CSD_WIDGETS
void InitUART(void);
void InitCapSense(void);
void UpdateCapSense(void);
void DetectHandPosition(void);