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 0:c2e9b51c378c, committed 2015-11-17
- Comitter:
- ZirkofDGJ
- Date:
- Tue Nov 17 05:01:11 2015 +0000
- Commit message:
- Comunicacion Serial con LCD 16x2
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Tue Nov 17 05:01:11 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/simon/code/TextLCD/#308d188a2d3a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Nov 17 05:01:11 2015 +0000
@@ -0,0 +1,59 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(PTB2, PTB3, PTB10, PTB11, PTC11, PTC10, TextLCD::LCD16x2); // rs, e, d4-d7
+AnalogIn V(PTC2);
+Serial PC(USBTX, USBRX);
+DigitalOut LED(PTB22);
+
+void Config_ptos(void);
+void Proceso(void);
+void Presentacion(void);
+void Lectura(void);
+
+float Vr = 3.3, Df = 0.991;
+float Vd, Vo;
+
+int main()
+{
+ Config_ptos();
+ while(1) {
+ Proceso();
+ }
+}
+
+void Config_ptos(void)
+{
+ PC.format(8, Serial::None, 1);
+ PC.baud(9600);
+ LED = 1;
+}
+
+
+void Proceso(void)
+{
+ //if(PC.readable()) {
+ if(PC.getc()=='A') {
+ LED = 1;
+ }
+
+ if(PC.getc()=='B') {
+ LED = 0;
+ }
+
+ //}
+
+ //if(PC.writeable()) {
+ Vo = V.read();
+ Vd = Vr * Vo/ Df;
+
+ lcd.locate(0,0);
+ lcd.printf("V = %f V", Vd);
+
+ PC.printf("V = %f V\n", Vd);
+ PC.printf("\r\n");
+
+ wait_ms(500);
+ lcd.cls();
+ //}
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Nov 17 05:01:11 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file