Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 6 months ago.
nothing appear on tera term.
#include "mbed.h"
#include "rtos.h"
#include "stdio.h"
#include "C12832_lcd.h"
Serial pc(USBTX, USBRX);
C12832_LCD lcd;
AnalogIn Ain(p20);
Mutex lcd_mutex;
void thread(void const *arge)
{
int col,height;
float ADCdata;
while(1)
{
lcd_mutex.lock();
int c1=0,c2=0,c3=0;
float d=0,e=0;
for(col=0; col<129; col++)
{
ADCdata = Ain*3.3;
height=31-int(ADCdata*10);
lcd.pixel(col, height, 1);
wait(0.005);
lcd.copy_to_lcd();
lcd_mutex.unlock();
d=ADCdata;
if( d>e && d>=1)
{
c1=col;
}
else if(c2 == 0 )
{
c2 = c1;
c1 = 0;
}
else if(c3==0 && c2!=0)
{
c3=c1;
}
e=d;
if(c1!= c3 && c1!=127 && c3!=0)
{
lcd.locate(0,0);
int d = abs(c3-c2)+abs(c1-c3);
lcd.printf("%d BPM\n", d);
}
else if(c3!=0)
{
lcd.locate(0,0);
int d1=(abs(c3-c2)*10);
lcd.printf("%d BPM", d1);
}
wait(0.0000005);
}
int distance=abs(c3-c2)+abs(c1-c3);
wait(1);
pc.printf("Heart rate = %d bpm\n", distance);
if(distance < 101 && distance > 59)
{
pc.printf("Heart rate = = normal\n");
}
else if(distance > 100)
{
pc.printf("Heart rate = not normal, see a doctor\n");
}
else
{
pc.printf("Heart rate = unhealthy, go for a checkup\n");
}
lcd.cls();
}
}
int main()
{
lcd.cls();
Thread t(thread);
while(1);
}
this is my programing for the ECG signal from the LCD to the tera term but the tera term didn't appear anything at all. Please help me in this!
2 Answers
9 years, 6 months ago.
make sure that your baud rate of your tera term matches the baud rate of your program :)
9 years, 6 months ago.
For Windows, you have to install serial driver.
https://developer.mbed.org/handbook/Windows-serial-configuration
is serial driver and serial port the same? the terminal receive line i also change it to LF.
posted by 29 Apr 2016
Please use
When posting code so that the formatting is maintained.
posted by Andy A 27 Apr 2016alright done thanks.
posted by kevan foong 27 Apr 2016