speed controller

koh

New Member
im doing PIC programming. my task is to capture the clock pulse for one period in order for me to do speed controller. i have found a source code for this speed controller, but my problem is need to C language. Could somebody help me to convert it??Tx

Below is the source code:

Device = 16F877
Xtal = 20

Dim Result as DWord

LCD_DTPIN = PORTB.4 ' Setup the LCD
LCD_RSPIN = PORTB.2 '
LCD_ENPIN = PORTB.3 '
LCD_INTERFACE = 4 '
LCD_LINES = 2 '
LCD_TYPE = 0 '

All_Digital = True ' Make all pins Digital I/O's

While 1 = 1

Result = COUNTER PORTA.0, 100 ' Count how many pulses in 100mS

Result = Result * 10 * 60 ' Scale To RPM

Print at 1, 1, "RPM = ", DEC8 Result ' Display on the LCD

Wend ' Loop for ever
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…