Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
funcion_comun.h
- Committer:
- cristianvillarraga
- Date:
- 2018-11-17
- Revision:
- 1:ebfb091d5b63
- Child:
- 2:15facba8b8b4
File content as of revision 1:ebfb091d5b63:
#include "mbed.h" #ifndef funcion_comun #define funcion_comun SPI deviceM(PB_15, PB_14, PB_13);//puertos usados para conectar la matriz DigitalOut ssel (PB_12);//puertos usados para conectar la matriz void sendSPI(uint8_t d1, uint8_t d2)//envia datos a la tarjeta, cierra y abre puertos { deviceM.unlock(); ssel=0; deviceM.write(d1); deviceM.write(d2); ssel=1; deviceM.lock(); } void test() //Test { sendSPI(0x09,0); //No decodificacion sendSPI(0x0B,0x07); //Usa 8 leds sendSPI(0x0C,1); //No se apaga sendSPI(0x0A,0xe); for (int i=0;i<2;i++) { sendSPI(0x0F,1); wait (0.1); sendSPI(0x0f,0); wait (0.1); } } void borrar() //borra toda la matriz; { for(int i=0;i<=8;i++)//contador para recorrer posiciones { sendSPI(0x0+i,0x00);//recorre bit por bit colocando solo 0 } } #endif