最近好多小伙伴在玩灯玩点阵,也开始跃跃欲试了,
参考了卓大的 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网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
与电子爱好者谈读图二被打赏50分 | |
【FRDM-MCXN947评测】Core1适配运行FreeRtos被打赏50分 | |
【FRDM-MCXN947评测】双核调试被打赏50分 | |
【CPKCORRA8D1B评测】---移植CoreMark被打赏50分 | |
【CPKCORRA8D1B评测】---打开硬件定时器被打赏50分 | |
【FRDM-MCXA156评测】4、CAN loopback模式测试被打赏50分 | |
【CPKcorRA8D1评测】--搭建初始环境被打赏50分 | |
【FRDM-MCXA156评测】3、使用FlexIO模拟UART被打赏50分 | |
【FRDM-MCXA156评测】2、rt-thread MCXA156 BSP制作被打赏50分 | |
【FRDM-MCXN947评测】核间通信MUTEX被打赏50分 |