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.
main.cpp
- Committer:
- montse
- Date:
- 2020-06-01
- Revision:
- 25:2c788580a6aa
- Parent:
- 24:7f14b70fc9ef
File content as of revision 25:2c788580a6aa:
#include "mbed.h"
#include "C12832.h"
Timer tiempoA;
Ticker Solo;
InterruptIn boton(p5);
C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p8, p11);
//El programa tarda 20 segundos para mostrar el primer mensaje
int a;
void frase(){
lcd.locate(45, 10);
srand(time(NULL));
a=rand()%5;
lcd.printf("",a);
lcd.cls();
switch(a)
{
case 0:
lcd.printf("Edwin");//Bloque de instrucciones 0;
break;
case 1:
lcd.printf("Jair"); //Bloque de instrucciones 1;
break;
case 2:
lcd.printf("Karla"); //Bloque de instrucciones 2;
break;
case 3:
lcd.printf("Manuel"); //Bloque de instrucciones 3;
break;
case 4:
lcd.printf("Montse"); //Bloque de instrucciones 4;
break;
}
lcd.copy_to_lcd();
}
void limpiarlcd(){
lcd.cls();
}
int main() {
tiempoA.start();
Solo.attach(frase, 20);
boton.rise(limpiarlcd);
}