Automatic VB6 to pic serial connection


Results 1 to 14 of 14

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The usual way is to call it in a module and use the function in your code.

    Add a module to your project and past the following ones...
    Code:
            Option Explicit
    
    Private Declare Function GetTickCount Lib "kernel32" () As Long
    
    Public Function GetTicks() As Long
            GetTicks = GetTickCount()
            End Function
    In your Form(s), you just need to call it..
    Code:
            Option Explicit
            Dim TickValue As Long
    
    Private Sub Form_Load()
            Command1.Caption = "Start"
            Command2.Caption = "Stop"
            Text1.Text = ""
            End Sub
    
    Private Sub Command1_Click()
            TickValue = GetTicks
            End Sub
    
    Private Sub Command2_Click()
            TickValue = GetTicks - TickValue
            Text1.Text = TickValue
            End Sub
    HTH
    Last edited by mister_e; - 7th January 2008 at 21:33. Reason: Long instead of double :o)
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Midi, Interrupts and Pic better than SX28?
    By Lajko in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2008, 00:26
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  3. PIC to serial with visual basic
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 31st March 2007, 16:06
  4. PIC to PIC serial resistor?
    By RYTECH in forum Serial
    Replies: 0
    Last Post: - 5th September 2006, 15:46
  5. serial comm from Pic to STAMP
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th April 2004, 23:58

Members who have read this thread : 2

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