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
Fork of DataLoggerRS232trial by
main.cpp
00001 #include "mbed.h" 00002 #include "DataLoggerRS232.h" 00003 00004 Serial pc (USBTX, USBRX); // tx, rx 00005 Serial dataLogger (PA_2,PA_3); // tx, rx 00006 00007 //char DLcommand; 00008 int abc[]={104,87,36,19,0,0,0,104,17,4,51,51,51,51,63,22}; 00009 00010 char DLcommand2; 00011 int main() { 00012 00013 pc.baud(115200); 00014 pc.printf("PC and Datalogger serial set up complete !!\n\r"); 00015 dataLogger.baud(2400); 00016 dataLogger.format(9,SerialBase::Even,1); 00017 pc.printf("Here !!\n\r"); 00018 int i; 00019 const int m=16; 00020 while(1) { 00021 i=0; 00022 // if(pc.readable()) { 00023 if(dataLogger.writeable()){ 00024 for(i=0;i<m;i++){ 00025 dataLogger.putc(abc[i]); 00026 } 00027 pc.printf("T"); 00028 // dataLogger.printf("%c",DLcommand); 00029 // dataLogger.count = 0; 00030 // DLcommand = pc.getc(); 00031 // pc.printf("\n\r%c\n\r",DLcommand); 00032 00033 // dataLogger.putc(DLcommand); 00034 // dataLogger.get_ECU_databyte(); 00035 } 00036 // dataLogger.display_ECU_databyte(); 00037 // wait(4); 00038 //----------------------------------------------- 00039 if(dataLogger.readable()) { 00040 pc.printf("R"); 00041 char DLcommand[25]; 00042 // dataLogger.count = 0; 00043 for(i=0;i<25;i++){ 00044 DLcommand[i]= dataLogger.getc(); 00045 pc.putc(DLcommand[i]); 00046 } 00047 // DLcommand = dataLogger.getc(); 00048 // DLcommand2 = dataLogger.getc(); 00049 00050 ; 00051 // pc.printf("\n\r%c\n\r",DLcommand2); 00052 // dataLogger.putc(DLcommand); 00053 // dataLogger.get_ECU_databyte(); 00054 } 00055 // dataLogger.display_ECU_databyte(); 00056 00057 wait(4); 00058 00059 }}
Generated on Sat Jul 30 2022 16:22:58 by
1.7.2
