Sunday, 29 November 2015

Float to String PIC16F88 FlowCode Microcontroller Programming And Simulation

In this sample project we are using Programming Software FlowCode for writing a program to convert Float Data to String Array using micro-controller of PIC16 Family PIC16F88 for testing and Simulation.Project shows how we are outputting results values to LCD ( Liquid Crystal Display ).Varying the delay and write-erase sequence can be manipulated to get desired result.
Above is the Flow code program Snapshot.

Recent Related Programs
String To Float Data Type Conversion
LCD Interfacing With Keypad PIC16F877A
Keypad and LED Interfacing With PIC16F88

Here is the complete list of projects:
Tutorials for Flow Code Programming and Simulation

Flow code Simulation and how to do Video Tutorial:

A brief introduction to the concept of Data types and String Array:-

Data types in c refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.Data Types in C can be classified as follows −(a) integer types and (b) floating-point types.

A. Integer Types: The following table provides the details of standard integer types with their storage sizes and value ranges(See Image above).

B. Floating-Point Types: The following table provide the details of standard floating-point types with storage sizes and value ranges and their precision(See Image above).

An example of how to declare a float variable in the C language.

#include <stdio.h>
int main()
float age;
age = 2.4;
printf("Ingenuity Dias is over %f years old.\n", age);
return 0;

This C program would print "Ingenuity Dias is over 2.400000 years old."

Strings are actually one-dimensional array of characters terminated by a null character '\0'. Thus a null-terminated string contains the characters that comprise the string followed by a null.

The following declaration and initialization create a string consisting of the word "Hello". To hold the null character at the end of the array, the size of the character array containing the string is one more than the number of characters in the word "Hello."

char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'}; OR
char greeting[] = "Hello";

Following is the memory presentation of the above defined string in C

Example Programming Codes:
#include <stdio.h>
int main () 
   char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'};
   printf("Greeting message: %s\n", greeting );
   return 0;

When the above code is compiled and executed, it produces the following result −
Greeting message: Hello

Micro-controller used is PIC16F88 with LCD Panel for displaying values on display.We have use different values for proper understanding.

In video you will be able to see step-wise execution of program and their effect on LCD in panel which is by default in the software .

You can Download Flowcode Program File :

C Code File
Flow Code Program File
ASM Code File

No comments:

Post a Comment

Readers' Choice