- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Iam trying to interface a temperature sensor to the CY8CKIT-050. however, there is a problem with the software below.
#include <project.h>
#include "stdio.h"
int main()
{
float T;
int32 voltcount;
float volt;
char str[16];
LCD_Start();
ADC_Start();
ADC_StartConvert();
for(;;)
{
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
voltcount=ADC_GetResult16();
volt=ADC_CountsTo_Volts(voltcount);
T=85.543*(1.8641-volt);
sprintf(str, "%+1.4f", T); //pretty sure the problem lies here 🙂
LCD_Position(0u,0u);
LCD_PrintString(str);
}
}
the project consists of a LCD and a temperature sensor. the PSOC5 reads the output from the sensor and displays it on the LCD.
I did some debugging, triple checked the connections, checked the LCD and it's working. but I am quite sure that the problem lies in the sprintf function.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
never mind, never mind. I have read this subject and it worked like a charm:
http://www.cypress.com/?app=forum&id=2492&rID=86619
u know cypress should inform us when making changes like that. I almost gone crazy over this bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Bob.
Regards,
Mahmood