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.
Dependencies: mbed mbed-STM32F103C8T6
Diff: main.cpp
- Revision:
- 3:05bb8f0bd7a4
- Parent:
- 2:e7b3b8da71ff
- Child:
- 6:41a4ad385daa
--- a/main.cpp Mon Jul 12 10:03:53 2010 +0000
+++ b/main.cpp Wed Apr 25 09:30:02 2012 +0000
@@ -35,15 +35,25 @@
DigitalIn down(p23);
DigitalIn left(p24);
DigitalIn up(p25);
+Serial pc(USBTX, USBRX);
+
ecu_reader obdii(CANSPEED_500); //Create object and set CAN speed
void gps_demo(void);
void sd_demo(void);
int main() {
-
+ pc.baud(115200);
char buffer[20];
-
+
+ //Enable Pullup
+ click.mode(PullUp);
+ right.mode(PullUp);
+ down.mode(PullUp);
+ left.mode(PullUp);
+ up.mode(PullUp);
+
+ printf("ECU Reader \n");
lcd.locate(0,0); // Set LCD cursor position
lcd.printf("CAN-Bus demo");
@@ -58,6 +68,8 @@
lcd.locate(0,1);
lcd.printf("U-CAN:D-GPS:L-SD");
+
+ pc.printf("\nU-CAN:D-GPS:L-SD");
while(1) // Wait until option is selected by the joystick
{
@@ -80,6 +92,7 @@
{
lcd.locate(0,0);
lcd.printf(buffer);
+ pc.printf(buffer);
}
if(obdii.request(ENGINE_COOLANT_TEMP,buffer) == 1)
@@ -134,6 +147,7 @@
void sd_demo(void)
{
lcd.cls();
+ printf("\nSD demo");
lcd.printf("SD demo");
wait(2);
lcd.cls();
@@ -142,11 +156,13 @@
if(fp == NULL) {
lcd.cls();
lcd.printf("Could not open file for write\n");
+ pc.printf("\nCould not open file for write");
}
fprintf(fp, "Hello fun SD Card World! testing 1234");
fclose(fp);
lcd.locate(0,1);
lcd.printf("Writtern to SD card");
+ pc.printf("\nWrittern to SD card");
while(1)
{