Do I like my C compiler? Well it has its advantages in many situations, but I still love PBP.
Try doing this in basic:
Code:
/////////////////////////////////////////////////////////////////////////
//// Polarization analysis.C ////
//// ////
//// This program shows input, output and standard operations with ////
//// floating piont numbers. I/O is RS232. ////
//// The equation is applied to the numbers entered and the result ////
//// is printed to the screen. hansknecht 5/12/04 ////
/////////////////////////////////////////////////////////////////////////
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#include <stdlib.h>
#include <input.c>
#include <math.h>
void main()
{
float a, b, pol_res;
do {
printf("\r\nEnter first number: "); //prompt user for number
a=get_float(); // bring number in
printf("\r\nEnter second number: "); // prompt for second number
b=get_float();
pol_res = (2*(SQRT (a*b))/(a+b))* 100; // perform calculation
printf("\r\nPolarization = ",pol_res, " %"); // display result
} while (TRUE);
}
I also like the wizard associated with the CCS C compiler. When you start a new project it asks you questions like "Do you want to use the on-board ADC?" or "Do you want to use the Capture-Compare?". Based on your answer it automatically inserts the necessary code for initialization.
All this comes at a $$$ price. PBP is a great affordable compiler for 90% of my projects.
-John
Bookmarks