最近好多小伙伴在玩灯玩点阵,也开始跃跃欲试了,
参考了卓大的 http://forum.eepw.com.cn/thread/277411/2
对应关系,来自mbed\TARGET_NUCLEO_L053R8\TARGET_STM\TARGET_STM32L0\TARGET_NUCLEO_L053R8\PinNames.h
// Arduino connector namings A0 = PA_0, A1 = PA_1, A2 = PA_4, A3 = PB_0, A4 = PC_1, A5 = PC_0, D0 = PA_3, D1 = PA_2, D2 = PA_10, D3 = PB_3, D4 = PB_5, D5 = PB_4, D6 = PB_10, D7 = PA_8, D8 = PA_9, D9 = PC_7, D10 = PB_6, D11 = PA_7, D12 = PA_6, D13 = PA_5, D14 = PB_9, D15 = PB_8, // Generic signals namings LED1 = PA_5, LED2 = PA_5, LED3 = PA_5, LED4 = PA_5, USER_BUTTON = PC_13, SERIAL_TX = PA_2, SERIAL_RX = PA_3, USBTX = PA_2, USBRX = PA_3, I2C_SCL = PB_8, I2C_SDA = PB_9, SPI_MOSI = PA_7, SPI_MISO = PA_6, SPI_SCK = PA_5, SPI_CS = PB_6, PWM_OUT = PB_3,
小伙伴们说要滚动,没办法,吃晚饭又开始折腾滚动效果,不会发视频,就发代码吧,滚动的EEPWNET几个字母
#include "mbed.h" SPI device(SPI_MOSI, SPI_MISO, SPI_SCK); DigitalOut mycs(D10); unsigned char map[60] = { //43 0B00000000, 0B11111111, 0B10001001, 0B10001001, 0B10000001, 0B00000000, 0B11111111, 0B10001001, 0B10001001, 0B10000001, 0B00000000, 0B11111111, 0B00001001, 0B00001001, 0B00000110, 0B00000000, 0B11111111, 0B01000000, 0B00110000, 0B01000000, 0B11111111, 0B00000000, 0B11111111, 0B00001000, 0B00010000, 0B00100000, 0B11111111, 0B00000000, 0B11111111, 0B10001001, 0B10001001, 0B10000001, 0B00000000, 0B00000001, 0B00000001, 0B11111111, 0B00000001, 0B00000001, 0B00000000, 0B00000000, 0B00000000, 0B00000000, 0B00000000, //8 0B00000000, 0B01101100, 0B11111110, 0B11111110, 0B01111100, 0B00111000, 0B00010000, 0B00000000, //8 0B11111111, 0B10100101, 0B11000011, 0B10000001, 0B10111101, 0B10100101, 0B10100101, 0B11111111, //1 0B00000000 }; int main() { int i = 0; long k=0; while(1) { k++; int j=(k/200)%43; for(i=1;i<256;i*=2) { device.write(i); device.write(0); device.write(0xff-map[j]); mycs=0; mycs=1; j=(j+1)%43; wait_us(50); } } }
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
vscode+cmake搭建雅特力AT32L021开发环境被打赏30分 | |
【换取逻辑分析仪】自制底板并驱动ArduinoNanoRP2040ConnectLCD扩展板被打赏47分 | |
【分享评测,赢取加热台】RISC-V GCC 内嵌汇编使用被打赏38分 | |
【换取逻辑分析仪】-基于ADI单片机MAX78000的简易MP3音乐播放器被打赏48分 | |
我想要一部加热台+树莓派PICO驱动AHT10被打赏38分 | |
【换取逻辑分析仪】-硬件SPI驱动OLED屏幕被打赏36分 | |
换逻辑分析仪+上下拉与多路选择器被打赏29分 | |
Let'sdo第3期任务合集被打赏50分 | |
换逻辑分析仪+Verilog三态门被打赏27分 | |
换逻辑分析仪+Verilog多输出门被打赏24分 |