Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: mscomm32 help.

  1. #11
    Phone Control Moderator zorro's Avatar
    Join Date
    Mar 2004
    Location
    Munich, Germany
    Posts
    1,902
    The interesting part is :
    93 0.00181072 VB6.EXE IRP_MJ_WRITE VCP0 SUCCESS Length 20: 12345678901234567890
    which shows success. This means, it leaves your PC without problems. So I guess the problem is with the VFD.

    You might try to slow down the transmisson and set it to 9600 baud.

    The other way is:

    Code:
        Dim Msg As String
        Dim i As Integer
        Msg = "1234567890abcdefghijk"
        
        For i = 1 To Len(Msg)
            vfdCom.Output Mid(Msg, i, 1)
        Next
    Skinning to go... VisualDesigner2!

  2. #12
    Variable Bitrate
    Join Date
    Sep 2004
    Posts
    440
    Thaks man that will save some time on my end. I hate dealing with strings lol.

  3. #13
    Variable Bitrate
    Join Date
    Sep 2004
    Posts
    440
    Well I got all the worked out thanks to you guys. Would any of you super vb people like to help me figure out how to make a trackbar sub? Basicly it would look like this:

    : ~ :

    and of corse this tilda would move along with the track bar in winamp. I just got to figure out a way to make a sub to crate the graph when it needs to be updated (ie: when the song has moved far enough along that the tilda needs to move a block over).

  4. #14
    What can I say? I like serial. Curiosity's Avatar
    Join Date
    Mar 2004
    Location
    Florence Yall, BFKY
    Posts
    2,684
    I'm not a VB guy, but can do math.

    ' width would be the width of the display
    width = 10
    ' position and duration of song in seconds, converted to 0-9 range
    pos = position * width / duration
    ' don't update unless it changed
    if(pos = lastpos) then return
    lastpos = pos
    ' make a 10 char string with the ~ somewhere in the middle
    Dim str
    str = String(pos, " ") + "~" + String(width - pos - 1, " ")

    Well, okay that's a starting point at least.

  5. #15
    Variable Bitrate
    Join Date
    Sep 2004
    Posts
    440
    Thanks thats a good start. Of corse the little bar I made on here the forums removed the extra spaces :/ oh well I think you got the jist of it. Now off to to refine it.

  6. #16
    Phone Control Moderator zorro's Avatar
    Join Date
    Mar 2004
    Location
    Munich, Germany
    Posts
    1,902
    Try this:
    Code:
    Sub DrawBar()
        Dim Bar As String
        Dim i As Integer
        Dim Pos as Integer 
        
        Bar = ":------------------:"
        Pos = CalcPos
        Mid(Bar, Pos, 1) = "~"
        
        For i = 1 To Len(Bar)
            vfdCom.Output Mid(Bar, i, 1)
        Next
    
    End Sub
    
    Function CalcPos() As Integer
    
        CalcPos = 4   'calc the pos and return an integer between 2 and 18
        
    End Function
    About time to buy yourself a good book
    Skinning to go... VisualDesigner2!

  7. #17
    Variable Bitrate
    Join Date
    Sep 2004
    Posts
    440
    Thanks man. Don't worie you will all get credit in the software for the help. I have a bunch of vb books but I am at work and don't have them on hand for referance.

  8. #18
    Variable Bitrate
    Join Date
    Sep 2004
    Posts
    440
    Well this is what I ended up with:

    Code:
    Sub DrawBar()
        Dim Bar As String
        Dim i As Integer
        Dim pos As Integer
        
        Bar = ":------------------:"
        pos = CalcPos
    
        If pos = 0 or pos = 1 Then
            Mid(Bar, pos + 1, 1) = ">"
        Else
            Mid(Bar, pos, 1) = ">"
        End If
        
        For i = 1 To Len(Bar)
            vfdCom.Output = Mid(Bar, i, 1)
        Next
    
    End Sub
    
    Function CalcPos() As Integer
        Dim length As Long
        Dim position As Long
        Dim x As Integer
        
        WinAMP_FindWindow
        length = WinAMP_GetTrackLength()
        position = WinAMP_GetTrackPosition()
        
        x = position * 19 / length
        
        CalcPos = x 'calc the pos and return an integer between 2 and 18
        
    End Function
    I'm guessing some thing is off sence i had to use an if statment to get it to display from 2-19. I can clean up those if statments a bit but I was wondering what I have wrong in there that would make the if statments needed?

  9. #19
    What can I say? I like serial. Curiosity's Avatar
    Join Date
    Mar 2004
    Location
    Florence Yall, BFKY
    Posts
    2,684
    My bad. I was thinking 0-based and missed the colons. So just change the math to...

    x = 2 + (position * 18 / length)

    Zorro, I think I need to buy me a good book too!

  10. #20
    Phone Control Moderator zorro's Avatar
    Join Date
    Mar 2004
    Location
    Munich, Germany
    Posts
    1,902
    A good book never failes
    Skinning to go... VisualDesigner2!

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

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