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
#include "Arduino_LED_Matrix.h" | |
#include "misakiUTF16.h" | |
ArduinoLEDMatrix matrix; // LEDマトリックスドライバ | |
unsigned long frame[] = {0,0,0}; // 12x8ドット フレームバッファ | |
// フレームバッファの指定座標にドットをセット | |
void setAt(uint8_t x, uint8_t y, uint8_t color) { | |
if (x>=12 || y >=8) { | |
return; |
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
from machine import Pin, SPI | |
from device.max7219 import Matrix8x8 | |
from time import sleep, sleep_ms | |
from misakifont import MisakiFont | |
# メッセージボード | |
class MessageBoard(Matrix8x8): | |
# コンストラクタ | |
def __init__(self, spi, cs, num): |
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
// | |
// 4桁高輝度緑色7セグメントLED表示器(アノードコモン) OSL40562-IG の制御 | |
// 2021/03/20 たま吉さん | |
// 利用パーツ | |
// 4桁7セグメントLED OSL40562-IG x 1 | |
// 桁制御用トランジスタ 2SA1015L-GR x 4 | |
// LED電流制御用抵抗 330Ω x 8 | |
// トランジスタベース抵抗 10kΩ x 4 | |
// |
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
#include <stdio.h> | |
#include "pico/stdlib.h" | |
#define MAXLED 8 | |
// 8個のLEDのPIN番号割り付け | |
const uint8_t LED_PIN[MAXLED] = {2, 3, 4, 5, 6, 7, 8, 9}; | |
// 8個のLEDの更新表示 | |
void update(uint8_t value) { |
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
/** | |
* 8個のLEDの制御 | |
* 2021/03/03 たま吉さん | |
* | |
*/ | |
#include "pico/stdlib.h" | |
#define MAXLED 8 | |
// 8個のLEDのPIN番号割り付け |
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
cmake_minimum_required(VERSION 3.13) | |
message("** LEDサンプルプログラム **") | |
# initialize the SDK based on PICO_SDK_PATH | |
# note: this must happen before project() | |
include(pico_sdk_import.cmake) | |
project(led) |
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
// | |
// M5Stack フォント表示サンプル | |
// 作成 2020/02/04 by たま吉さん | |
// | |
#include <M5Stack.h> | |
#include <sdfonts.h> | |
#define SD_PN 4 | |
// スクロールアップ(M5stackでは動かない) |
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
// | |
// MML演奏サンプル for M5Stack 2020/01/25 | |
// | |
#include <M5Stack.h> | |
#include "MML.h" | |
MML mml; // MML文演奏管理 | |
// デバイス初期化関数 |
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
#include <M5Stack.h> | |
// toneEx | |
// 引数 | |
// frequency (Hz) | |
// vol (0 ~ 9、0:無音 9:最大) | |
void toneEx(uint16_t frequency, uint16_t vol) { | |
ledcSetup(TONE_PIN_CHANNEL, frequency, 10); | |
ledcWrite(TONE_PIN_CHANNEL,0x1FF>>(9-vol)); | |
} |
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
#include <M5Stack.h> | |
#include <misakiUTF16.h> | |
// ビットマップの拡大描画 | |
void drawBitmapEx(int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, | |
uint16_t color,uint16_t bgcolor, uint16_t ex) { | |
int16_t i, j,b=(w+7)/8; | |
for( j = 0; j < h; j++) { | |
for(i = 0; i < w; i++ ) { |
NewerOlder