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.
Revision 7:5f1c8385cf8e, committed 2018-11-22
- Comitter:
- jiuk
- Date:
- Thu Nov 22 10:38:28 2018 +0000
- Parent:
- 6:4c9e8118c303
- Commit message:
- final final este si es...;
Changed in this revision
| recoge_manzanas.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4c9e8118c303 -r 5f1c8385cf8e recoge_manzanas.cpp
--- a/recoge_manzanas.cpp Thu Nov 22 09:57:49 2018 +0000
+++ b/recoge_manzanas.cpp Thu Nov 22 10:38:28 2018 +0000
@@ -33,7 +33,58 @@
bool _boton=0;
void blink();
void boton();
-void sendSPI();
+void sendSPI(uint8_t,uint8_t);
+
+
+//--------------------------------------------------
+//-------------------CARA_FELIZ------------------------
+//--------------------------------------------------
+void cara_feliz()
+{
+ sendSPI(0x02,0b01100110);
+ wait(0.2);
+ sendSPI(0x03,0b01100110);
+ wait(0.2);
+ sendSPI(0x06,0b01000010);
+ wait(0.2);
+ sendSPI(0x07,0b00111100);
+ wait(0.2);
+ for(int i=0;i<4;i++)
+ {
+ sendSPI(0x06,0x00);
+ sendSPI(0x07,0b00111100);
+ wait(0.2);
+ sendSPI(0x07,0b00111100);
+ wait(0.2);
+ sendSPI(0x06,0b01000010);
+ wait(0.2);
+ }
+}
+
+//--------------------------------------------------
+//-------------------CARA_TRISTE------------------------
+//--------------------------------------------------
+void cara_triste()
+{
+ sendSPI(0x02,0b01100110);
+ wait(0.2);
+ sendSPI(0x03,0b01100110);
+ wait(0.2);
+ sendSPI(0x06,0b00111100);
+ wait(0.2);
+ sendSPI(0x07,0b01000010);
+ wait(0.2);
+ for(int i=0;i<4;i++)
+ {
+ sendSPI(0x07,0x00);
+ sendSPI(0x06,0b00111100);
+ wait(0.2);
+ sendSPI(0x06,0b00111100);
+ wait(0.2);
+ sendSPI(0x07,0b01000010);
+ wait(0.2);
+ }
+}
//--------------------------------------------------
//-------------------TICKER------------------------
@@ -42,9 +93,9 @@
{
blink();
boton();
- if (command.readable())
+ if (com_tar.readable())
{
- //sendSPI(0x05,0xff);
+ cara_triste();
command.printf("Button pressed %b\n", _boton);
}
};
@@ -339,7 +390,7 @@
{
com_tar.putc(1);
command.printf("Enviado");
- //mostrar_carita_feliz();
+ cara_feliz();
}
x=1;
}