Complete project walk-thru, making a simple voltmeter with PSoC Creator with a PSoC3 or PSoC5 | Cypress Semiconductor
Complete project walk-thru, making a simple voltmeter with PSoC Creator with a PSoC3 or PSoC5
I know I said we wanted to keep these videos between 1 and 5 minutes, but this first video takes the first time or novice PSoC Creator user through a simple project from start to finish. The project is a simple voltmeter that measures a voltage between 0 and 1 volt and displays the result on a 2 by 16 character display with a floating point value. Although this project uses a PSoC3, it is equally compatible with PSoC 5. The video is about 15 minutes, but I recommend it for new users. If you don’t want to watch the entire video just fast forward to the parts of interest. You can download a copy of the project described in this video here.
The entire code for this project is shown below.
* Simple project to read a voltage between
* 0 and 1 volts and display it on an LCD.
ADC_Start(); /* Initialize components */
LCD_Position(0,0); /* Display message */
ADC_StartConvert(); /* Start ADC conversions */
for(;;) /* Loop forever */
if(ADC_IsEndConversion(ADC_RETURN_STATUS) != 0) /* Check for result */
adcResult = ADC_GetResult32() ; /* Get Reading */
adcVolts = ADC_CountsTo_Volts( adcResult) ; /* Convert to volts */
sprintf(tmpStr,"%+1.3f volts", adcVolts); /* Create a formatted string */
LCD_Position(1,0); /* Display on LCD */