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.
Fork of AUP_Lab2_PWM_UART by
Revision 1:08431d9e3d95, committed 2015-07-07
- Comitter:
- BrentLei
- Date:
- Tue Jul 07 23:27:48 2015 +0000
- Parent:
- 0:65e58765adf7
- Child:
- 2:eac7cbeb9da0
- Commit message:
- AUP_Lab4_LCD
Changed in this revision
| C12832.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C12832.lib Tue Jul 07 23:27:48 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/chris/code/C12832/#7de323fa46fe
--- a/main.cpp Thu May 21 02:23:19 2015 +0000
+++ b/main.cpp Tue Jul 07 23:27:48 2015 +0000
@@ -1,10 +1,11 @@
#include "mbed.h"
+#include "C12832.h"
PwmOut led(D5);
DigitalIn button_up(A2);
DigitalIn button_center(D4);
DigitalIn button_down(A3);
-Serial pc(SERIAL_TX, SERIAL_RX);
+C12832 lcd(D11, D13, D12, D7, D10);
double brightness = 1.0;
double brightness_inc = 0.1;
@@ -12,8 +13,9 @@
int main()
{
int bt_flag = 0;
- pc.baud(9600);
- pc.printf("Hello PWM!\r\n");
+ lcd.cls();
+ lcd.locate(0,0);
+ lcd.printf("Hello PWM!\r\n");
// Set PWM
led.write(brightness);
@@ -32,7 +34,8 @@
brightness = (brightness>1.0)?0.0:brightness;
brightness = (brightness<0.0)?1.0:brightness;
led.write(brightness);
- pc.printf("Brightness = %.1f\r\n", 1.0-brightness);
+ lcd.locate(0,0);
+ lcd.printf("Brightness = %.1f\r\n", 1.0-brightness);
}
wait(0.2); // 200 ms
}
