need bs2 code for 3 channel hz meter displayed on 2x16 backlit lcd
hate to be so needy all the time... i have three 500-650 hz signals that i need to use the COUNT method over 1/2 second to display rpm on a 2x16 backlit lcd screen. i have used the count method before but only to the debug screen. have no idea how to make it goto the lcd screen. i can submit the code i used in the past if the would help. Thanks for anyones time to help. this is used on a custom built cotton harvester. A John Deere 7760 Round Bale Picker that we converted to a Dual burr extracted 16 row stripper. We control all the row units height sensing with proportional controls and pwm control of pumps for hydraulic flow control. I am on the way to deliver this console and woud really like to be able to upload the code for lcd screen today. Jeff Kirk Farm Enhancement Systems 806-767-0715 sport270@yahoo.com

Comments
For idx = 5 to 0
char = value DIG idx ' pick off the digits with leading zeros
GOSUB sendChar2LCD
NEXT
There are excellent tutorials on LCDs, for example, there is a chapter on Using Character LCDs in Stampworks, download from Parallax.com.
Of course, this requires the variables used to all have been set in advance and the attached example code sets things up. I hope this helps.
and lcd display does not work, it beeps every few seconds and shows a random 8 and { and no backlight
' {$STAMP BS2} ' {$PBASIC 2.5} ' -----[ I/O Definitions ]------------------------------------------------- TX PIN 15 ' serial output to LCD ' -----[ Constants ]------------------------------------------------------- #SELECT $STAMP #CASE BS2, BS2E, BS2PE T2400 CON 396 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T9600 CON 240 T19K2 CON 110 #CASE BS2PX T2400 CON 1646 T9600 CON 396 T19K2 CON 188 #ENDSELECT LcdBaud CON T19K2 LcdBkSpc CON $08 ' move cursor left LcdRt CON $09 ' move cursor right LcdLF CON $0A ' move cursor down 1 line LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdCR CON $0D ' move pos 0 of next line LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdOn2 CON $17 ' LCD on; cursor off, blink on LcdOn3 CON $18 ' LCD on; cursor on, blink off LcdOn4 CON $19 ' LCD on; cursor on, blink on LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdCC3 CON $FB ' define custom char 3 LcdCC4 CON $FC ' define custom char 4 LcdCC5 CON $FD ' define custom char 5 LcdCC6 CON $FE ' define custom char 6 LcdCC7 CON $FF ' define custom char 7 ' DIR0 = 0 'pin to read left saw or X1X DIR1 = 0 'pin to read right saw or X2X DIR2 = 0 'Pin to read xauger or X3X DIR3 = 0 'pin to read pot for alarms on saws or A1A and is also A2A DIR4 = 0 'pin to read pot for alarm on xauger or A2A DIR5 = 0 'pin to turn on buzzer connected to blue pulsing buzzer through transistor DIR6 = 0 'pin to turn on led for alarm DIR7 = 0 ' pin saved to read GROUND SPEED at later date DIR8 = 0 ' DIR9 = 0 ' DIR10 = 0 ' DIR11 = 0 ' DIR12 = 0 ' DIR13 = 0 ' DIR14 = 0 ' DIR15 = 0 ' ' ' -----[ Variables ]------------------------------------------------------- X1X VAR Word ' variable tag for rpm value of Left saw X2X VAR Word ' variable tag for rpm value of right saw X3X VAR Word ' variable tag for rpm value of xauger A1A VAR Word ' variable tag for alarm set point of BOTH saws A2A VAR Word ' variable tag for alarm set point of auger A3A VAR Word ' variable tag for alarm set point of right saw BUT REALLY EQUAL TO A1A ALARM VAR Word ' variable tag to turn on alarm ' -----[ Initialization ]-------------------------------------------------- Reset: HIGH TX ' setup serial output pin PAUSE 100 ' allow LCD to initialize ' -----[ Program Code ]---------------------------------------------------- ' Clear the display and remove cursor and blinking attributes. Main: SEROUT TX, LcdBaud, [LcdBLon, LcdOn1, LcdCls] PAUSE 100 ' GOSUB Pot_SAWS ' GET pot for alarms on saws ' GOSUB Pot_XAUGER ' GET pot for alarm on Xauger ' GOSUB X1X_SPEED 'GET SPEED OF LEFT SAW WITH COUNT ' GOSUB X2X_SPEED 'GET SPEED OF RIGHT SAW WITH COUNT ' GOSUB X3X_SPEED 'GE SPEED OF XAUGER WITH COUNT ' GOSUB Compare ' compare rpms to alarm set points ' 'gosub Set_ALARMS ' did this in compare ' GOSUB Update_LCD ' refreshes lcd display ' ' ' GOTO main ' ' ' ' -----[ Subroutines ]----------------------------------------------------- Update_LCD: SEROUT TX, LcdBaud, [LcdLine1, " ", DEC3 X1X, " ", DEC3 X3X, " ", DEC3 X2X] SEROUT TX, LcdBaud, [LcdLine2, " ", DEC3 A1A, " ", DEC3 A3A, " ", DEC3 A2A] RETURN 'NEW CODE BLOCKS************************************ ' ' ' ' ' '************************************* Pot_SAWS: 'input pin 03 .. 10K TRIMPOT, .1uf cap and 220 ohm in series to ' A1A = 0 'reset to 0 HIGH 3 'precharge the cap PAUSE 100 ' RCTIME 3,1,A1A ' PAUSE 10 ' 'debug "A1A is ",dec A1A,CR 'used to get real scale ' ' A1A = A1A+0 ' Add to or change scale to get into the range needed ' DEBUG "A1A is ",DEC A1A,CR ' ' PAUSE 100 ' ' A2A = A1A 'sets alarm for right saw the same as left ' RETURN ' '****************************** ' ' ' Pot_Xauger: 'input pin 04 .. 10K TRIMPOT, .1uf cap and 220 ohm in series to ' A3A = 0 'reset to 0 HIGH 4 'precharge the cap PAUSE 100 ' RCTIME 4,1,A3A ' PAUSE 10 ' 'debug "A3A is ",dec A3A,CR 'used to get real scale ' ' A3A = A3A+0 ' Add to or change scale to get into the range needed ' DEBUG "A3A is ",DEC A3A,CR ' ' PAUSE 100 ' ' ' RETURN ' ' ' '********************************** ' ' X1X_SPEED: 'get speed of left saw on pin 0 ' COUNT 0,500,X1X ' count pin 0 for 1/2 second X1X = X1X*2 ' correct reading to full second DEBUG "X1X IS ", DEC X1X,CR ' PAUSE 100 ' RETURN ' ' ' '################################### ' ' X2X_SPEED: 'get speed of left saw on pin 1 ' COUNT 1,500,X2X ' count pin 1 for 1/2 second X2X = X2X*2 ' correct reading to full second DEBUG "X2X IS ",DEC X2X,CR ' PAUSE 100 ' RETURN ' ' ' '********************************** ' ' X3X_SPEED: 'get speed of left saw on pin 2 ' COUNT 2,500,X3X ' count pin 2 for 1/2 second X3X = X3X*2 ' correct reading to full second DEBUG "X3X IS ",DEC X3X,CR ' PAUSE 100 ' RETURN ' ' ' '******************************** ' ' COMPARE: ' COMPARE SPEEDS TO ALARM SETPOINTS ' IF X1X < A1A THEN X2 ' ALARM = ALARM +1 'FLAG TO SET ALARM IF ANY ARE BELOW SETPOINT ' x2: ' IF X2X < A2A THEN X3 ' ALARM = ALARM +1 ' FLAG FOR ALARM ' X3: ' IF X3X < A3A THEN Alarm_SET ' ALARM = ALARM +1 ' ' Alarm_SET: ' ' ' IF ALARM <0 THEN A_ON ' ALARM=0 'RESET ALARM FLAG DEBUG "alarm off",CR ' LOW 5 'TURNS OFF BUZZER LOW 6 'TURNS OFF LED ' RETURN ' ' A_ON: 'TURNS ON ALARMS & BUZZER DEBUG "alarm on", CR ' HIGH 5 'turn on buzzer HIGH 6 'TURN ON LED PAUSE 100 'PAUSE LONG ENOUGH TO CHARGE CAP TO KEEP LED & BUZZER CONSTANT AND NOT INTERMITTENT 'ALARM=0 'RESET ALARM FLAG 'LOW 5 'TURNS OFF BUZZER 'LOW 6 'TURNS OFF LED ' RETURN ' ' 'Z**********************************