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: libmDot mbed-rtos mbed
Fork of CardRead_20170613 by
main.cpp
00001 #include "mbed.h" 00002 #include "mDot.h" 00003 #include "MTSLog.h" 00004 #include <string> 00005 #include <vector> 00006 #include <algorithm> 00007 #include <math.h> 00008 00009 #define RETURN_OK 0 00010 #define RETURN_ERR -1 00011 //define baudrate 00012 #define PC_BAUDRATE 115200 00013 #define CARD_MACHINE_BAUDRATE 19200 00014 00015 #define COMMAND_LENGTH 7 00016 #define RESPONSE_LENGTH 16 00017 #define RINGBUFFER_SIZE 100 00018 00019 #define READ_PERIOD 1 00020 #define SEND_PERIOD 5 00021 00022 Serial pc (USBTX, USBRX); 00023 Ticker timer; 00024 DigitalOut led1(PA_2); 00025 DigitalOut led2(PA_3); 00026 00027 int flip = 0; 00028 int abc = 0; 00029 mDot* dot; 00030 00031 void attime() { 00032 flip = !flip; 00033 abc = abc +1; 00034 if (abc == 2){ 00035 abc = 0; 00036 dot-> resetCpu(); 00037 } 00038 } 00039 00040 int main() { 00041 pc.baud(PC_BAUDRATE); 00042 pc.printf("11111"); 00043 00044 timer.attach(&attime, 5); 00045 pc.printf("22222"); 00046 while(1) { 00047 if(flip == 0) { 00048 led1 = !led1; 00049 } else { 00050 led2 = !led2; 00051 } 00052 pc.printf("33333"); 00053 wait(1); 00054 abc = 0; 00055 } 00056 }
Generated on Tue Jul 12 2022 20:33:15 by
1.7.2
