If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Here it is in operation ! It's doing a fine job, very happy with it.
Also a pic of the pickup coil embedded in epoxy inside a plastic tube, the magnet is epoxied to the shaft.
First, I would like to say thanks to Sam for sending me the code and the schematic.
Second, I have a question: what is the maximum RPM this circuit/code can read?
Thanks!
Daniel.
Hi Daniel,
I added this line:
to keep the display from rolling over 9999. What use do you have for this tach? I do not think I would try it on a turbine, as it updates too slowly, but it was written for a lathe. It will go over 9999 without that line, the max is unexplored. Perhaps someone who is skilled at math could tell you. The displays can be cascaded, if you feel adventurous.Code:if displays > 9999 then displays = 9999
Last edited by Archangel; - 13th March 2009 at 01:46.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
I try to use code from post #1 to my thermometer with 16F628A, DS18B20 and LED display ( like in : http://melabs.com/resources/articles/ledart.htm fig.6). To another topic, I receive one working code, from one user (thanks !).
But, I am still disappointed, because MY code don't work. Please, what's wrong with him ? Thank you !
Code:@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_ON, MCLR_OFF, LVP_OFF, CPD_OFF, PROTECT_OFF TRISA= %11110000 ' RA0..3=Outputs RA4=Input TRISB= %00000000 ' RB0..RB7=Outputs CMCON=7 ' Disable comparators DQ VAR PORTA.4 DS18B20_12bit CON %01111111 ' 750ms, 0.0625°C I VAR BYTE SIGN VAR BIT TEMPERATURE VAR WORD ; TEMPERATURE REGISTER n var byte segments var portb digits var porta value var word MAINloop : OWOUT DQ ,1,[$CC,$44] WaitLoop: While not DQ Wend OWOUT DQ ,1,[$CC,$BE] OWIN DQ ,2,[TEMPERATURE.LOWBYTE , TEMPERATURE.HIGHBYTE] IF TEMPERATURE.15 = 1 THEN TEMPERATURE = (65535 - TEMPERATURE) + 1 SIGN = 1 ELSE SIGN = 0 ENDIF value = (TEMPERATURE * 10)/16 gosub display goto mainloop ' Subroutine to send the number (0 - 9999) in Value to LEDs display: For i = 0 To 3 ' Loop through 4 digits n = value Dig i ' Get digit to display GoSub display1 ' Display the digit ' Leave it on 2 millisecondS Next i ' Do next digit Return ' Surboutine to display one digit on LED ' i = digit number ' n = number to display display1: 'Digits = $ff ' All digits off to prevent ghosting ' Convert binary number in n to segments for LED Lookup n, [$40, $79, $24, $30, $19, $12, $02, $78, $00, $18,$7f], Segments ' logic low complements ' Set digit pin i to 0 (on) and the rest of the pins to 1 (off) Digits = ~Dcd i Pause 1 'Increase to make digits brighter and flicker worse Return end
Bookmarks