LED Machine Tach For Tired Eyes


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    What use do you have for this tach?
    I have a few brushless R/C trucks, they have an optic sensor on the transmission and I would like to read the RPM. They go up to 50.000 RPM! I'll give it a try.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by danielhr77 View Post
    I have a few brushless R/C trucks, they have an optic sensor on the transmission and I would like to read the RPM. They go up to 50.000 RPM! I'll give it a try.
    Cool, keep us posted, I am curious as to the limits of count. I am thinking the variable might overflow if RPM goes too high, and you might have to alter the sampling rate or use some form of prescaler.
    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.

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Unhappy

    Hi, Fratello

    One thing is obvious ...

    The " Waitloop " , for sure, can't be used whith multiplexed LED's ...


    One thing is surprising ...

    Do you think your temp calculation is compatible with the provided Led Display ???


    One thing is really hazardous ...

    While dealing with the display ... you write over your PortA inputs as well as outputs !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Mea culpa...

    One, two, three things are for sure : I am a sucker !
    It's not the first time when "the language barrier" make me problem...I'm really sorry if I borried somebody .
    In the link that I posted it's the schematic (with reference to PBP code) I tried to make...It's sure that I must careful read (and understand !). Thank You verry much for attention and reply ! All the best !

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. LED Tach Sources?
    By Netjammer in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th October 2004, 03:47

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts