- リスト
- リスト2
- リスト3
- リスト2
- リスト
- リスト2
- リスト3
| //foo.h | |
| class foo { | |
| public: | |
| foo(); | |
| inline void hoge(){ | |
| printf("%f",v); //何故か0になる 多分初期化タイミングが違うけど何故? | |
| }; | |
| private: | |
| static const float v; | |
| } |
| import requests | |
| api_token = "yourApiToken" | |
| ret = requests.post("http://api.justyo.co/yoall/", data={'api_token': api_token}) | |
| print ret; |
| float readTouchPanel(PinName a, PinName b....){ | |
| DigitalOut dout(a); | |
| AnalogIn ain(b); | |
| dout = 1; | |
| return ain.read(); | |
| } |
| void hSync(byte a[][8]){ | |
| for(int i = 0;i < 8;i++){//階層ループ | |
| for(int j = 0;j < 8;j++){//列ループ | |
| for(int k = 0;k < 8;k++){ | |
| // このLEDCUBEではシフトレジスタのclk(SCK)とratch(RCK)を共有しています。 | |
| // そのため、8つのシフトレジスタのser(SI)にそれぞれデータをセットして | |
| digitalWrite(ser[k],bitRead(a[i][k],j)); | |
| } | |
| digitalWrite(clk,1); |
| # -*- coding utf-8 -*- | |
| import sys,time | |
| import numpy | |
| from PIL import Image, ImageSequence | |
| def clearDisplay(): | |
| print("\033[2J",end='') | |
| def printPixel(color): | |
| colorIn256 = 16 + round(color[0]/255*5) * 36 + round(color[1]/255*5) * 6 + round(color[2]/255*5) |
はじめに
1.1 本書の目標
1.2 使用するソフトウェアとその準備
キーボードを作るワークフロー
2.1 全体の流れ
2.2 ラフデザインから始めよう
2.3 部品の選定と回路図
2.4 ケースの設計
| import sys | |
| def generate_footprint(size, isPCB, hasLED, isReversible): | |
| unit = f"{size:.2f}" | |
| mount = "PCB" if isPCB else "Plate" | |
| # header | |
| body = f'(module SW_Cherry_MX1A_{unit}u_{mount}{"_LED" if hasLED else ""}{"_Reversible" if isReversible else ""} (layer F.Cu) (tedit 5BB19F47)\n' | |
| body += f' (descr "Cherry MX keyswitch, MX1A, {unit}u, {mount} mount, http://cherryamericas.com/wp-body/uploads/2014/12/mx_cat.pdf")\n' | |
| body += f' (tags "cherry mx keyswitch MX1A {unit}u {mount}{" Reversible" if isReversible else ""}")\n' |
windows上でstm32搭載のキーボードのファームウェアを書き換える際、usb-dfuブートローダのドライバを入れ替える必要があります。
STM Device in DFU Modeとして認識されているはず)Options → List All devicesにチェックSTM Device in DFU Modeを選択して、WinUSBをインストールするSTM32 Bootloaderとして認識されていればOK)| /* | |
| JoystickMouseControl | |
| Controls the mouse from a joystick on an Arduino Leonardo, Micro or Due. | |
| Uses a pushbutton to turn on and off mouse control, and a second pushbutton | |
| to click the left mouse button. | |
| Hardware: | |
| - 2-axis joystick connected to pins A0 and A1 | |
| - pushbuttons connected to pin D2 and D3 |