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
/* file stm32_timer_test3.ino | |
* Arduino STM32 TIMERとDMAの連携利用 | |
* 2017/02/13 by たま吉さん | |
* | |
* TIMERのPWM出力のデューティ比(HIGHの期間)をDMA経由でメモリーからロードして設定する | |
* TIMER4のCH4を利用する | |
* 比較レジスタをUPDATEのタイミングで変更し、LEDの点灯期間を変更する | |
* タイマーアップデート時間は4秒 | |
* 点灯期間を0.1~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
// | |
// Arduino STM32 NTSCビデオ出力 サンプル V2.1 | |
// 最終更新日 2017/02/17 たま吉さん | |
// Blue Pillボード(STM32F103C8)にて動作確認 | |
// | |
// 修正履歴 | |
// 2017/02/17 水平・垂直同期信号をPWM出力で行うように変更,解像度を224x216に変更 | |
// | |
#include <SPI.h> |
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
// | |
// FILE: stm_RTC_sample.ino | |
// Arduino STM32 内部RTCを利用して時刻を表示する | |
// 作成日 2017/03/30 by たま吉さん | |
// | |
#include <RTClock.h> | |
#include <time.h> | |
RTClock rtc(RTCSEL_LSE); |
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
// | |
// Arduino STM32 | |
// PWM出力サンプル(周波数,デューティ比指定) | |
// 2017/04/27 by たま吉さん | |
// | |
#if F_CPU == 72000000L | |
#define TIMER_DIV 72 | |
#else if F_CPU == 48000000L | |
#define TIMER_DIV 48 |
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
10 CLS | |
20 POKE MEM,$F0,$55,$00,0,0,0,0,0,0 | |
30 IF I2CW($52,MEM,2,MEM+2,0) END | |
40 "LOOP" | |
60 IF I2CR($52,MEM,0,MEM+3,6) END | |
50 IF I2CW($52,MEM+2,1,0,0) END | |
70 D=PEEK(MEM+8) | |
80 LOCATE 0,0 | |
90 ?#3,"X=";PEEK(MEM+3);" "; | |
100 ?#3,"Y=";PEEK(MEM+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
10 CLS | |
20 GPIO PB12,OUTPUT | |
30 GPIO PB13,OUTPUT | |
40 GPIO PB14,OUTPUT | |
50 D=$80 | |
60 FOR I=0 TO 6 | |
70 GOSUB "led" | |
80 D=D>>1 | |
90 WAIT 200 | |
100 NEXT I |
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
1 'MAX7219(PB13: CLOCK, PB12: CS, PB14: DAT) | |
100 GOSUB "INIT" | |
110 M="ネコニコンバンワ!" | |
120 L=LEN(M) | |
130 FOR I=1 TO L | |
140 A=ASC(M,I)*8+FNT | |
150 FOR J=0 TO 7 | |
160 R=J+1 | |
170 V=PEEK(A+J) | |
180 GOSUB "WRITE(R,V)" |
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
1 'MAX7219(PB13: CLOCK, PB12: CS, PB14: DAT) | |
100 GOSUB "INIT" | |
110 M="ネコニコンバンワ!" | |
115 T=100 | |
120 L=LEN(M) | |
130 FOR S=1 TO L | |
140 C=ASC(M,S) | |
150 GOSUB "SCROLLIN(C,T)" | |
160 NEXT S | |
170 END |
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
1 'DS3231(SDA=PB7,SCL=PB6) | |
10 CLS | |
20 M=MEM:A=$68 | |
30 'GOSUB "@SET" | |
40 "@LOOP" | |
50 GOSUB "@PRN" | |
60 WAIT 500 | |
70 GOTO "@LOOP" | |
80 END | |
90 "@SET" |
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
1 'SSD1306(PB6=SCL,PB7=SDA) | |
10 M=MEM:A=$3C:CLS | |
20 GOSUB "@INIT":GOSUB "@CLS" | |
30 X=0:Y=0:C=ASC("A"):GOSUB "@OUT(X,Y,C)" | |
40 X=1:Y=1:C=ASC("B"):GOSUB "@OUT(X,Y,C)" | |
50 X=2:Y=2:C=ASC("C"):GOSUB "@OUT(X,Y,C)" | |
60 X=0:Y=5:S="Hello":GOSUB "@PRN(X,Y,S)" | |
70 'WAIT 2000 | |
80 'GOSUB "@CLS" | |
90 GETTIME E,F,G |