EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / there is a sample visual

there is a sample visual

|

Microcontroller › PIC › Pic16f877a interface with ADST11SD300&310 Fingerprint Identification Module › there is a sample visual

November 8, 2013 at 5:14 am #10585
erwin
Participant

there is a sample visual basic 6 code and its working, but i want to make it stand alone by using MCU pic16f877a..i tried to analyze the program and i coded into mikro c but not working….

 

here is the code in vb6.

‘


Option Explicit
Dim SData(24) As Byte
Dim SReply(48) As Byte
Dim Replied As Boolean
Dim Rx As String
Dim CKS As Integer
‘


 

Private Sub cmdReg_Click()
Dim i As Integer
Dim dummy As String
Dim V1, V2 As Integer
Dim Good As Boolean
 
Good = True
 
V1 = Int(Val(txtUserNo.Text) / 256)
V2 = Val(txtUserNo.Text) – V1 * 256
 
For i = 1 To 22
    SData(i) = 0
Next i
SData(0) = &H55
SData(1) = &HAA
SData(2) = &H3
SData(3) = &H1
SData(4) = &H2
SData(5) = &H0
SData(6) = V2
SData(7) = V1
Call Checksum
dummy = MSComm1.Input
For i = 0 To 23
MSComm1.Output = Chr(SData(i))
Next i
back:
Replied = False
While Replied = False
    DoEvents
    Wend
If SReply(6) = 0 Then
    If Asc(Mid$(Right$(Rx, 24), 9, 1)) = &HF1 And Asc(Mid$(Right$(Rx, 24), 10, 1)) = &HFF Then
        txtResults.Text = “Press a finger to register first time.”
    End If
    If Asc(Mid$(Right$(Rx, 24), 9, 1)) = &HF2 And Asc(Mid$(Right$(Rx, 24), 10, 1)) = &HFF Then
        txtResults.Text = “Press the same finger the second time…”
    End If
    If Asc(Mid$(Right$(Rx, 24), 9, 1)) = &HF3 And Asc(Mid$(Right$(Rx, 24), 10, 1)) = &HFF Then
        txtResults.Text = “Press the same finger the last time…”
    End If
    If Asc(Mid$(Right$(Rx, 24), 9, 1)) = &HF4 And Asc(Mid$(Right$(Rx, 24), 10, 1)) = &HFF Then
        txtResults.Text = “Lift finger…”
    End If
    If Asc(Mid$(Right$(Rx, 24), 5, 1)) = &H6 Then
        txtResults.Text = “Ok”
        Exit Sub
    End If
    GoTo back
Else
    Print_Error
    If SReply(8) = &H21 Then GoTo back
    End If
End Sub
 
‘


 
Public Sub Checksum()
Dim i As Integer
CKS = 0
For i = 0 To 21
    CKS = CKS + SData(i)
 ‘   MsgBox (CKS)
Next i
 
SData(22) = CKS And &HFF
SData(23) = (CKS – (CKS And &HFF)) / 256
 MsgBox (SData(23))
End Sub

RSS Recent Posts

  • Sine wave distortion January 16, 2026
  • Flip Flop for My Mirrors January 16, 2026
  • potenciometer attachment / screwdriver January 16, 2026
  • flexible copper cable January 16, 2026
  • Variable audio oscillator January 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise