In SX Microcontrollers, SX/B Compiler and SX-Key Tool, DigitalDj wrote: PJ, Sorry I didn't get a email that there was a reply to the thread. Thanks for explaining and yes i'm a little hazy on the serial stuff. I now know to send a string it is $FF for 255 and requires 3 bytes which is what I don't want to do, correct? Since I can send ASCII to the board then I can truly send !PWM, 255, 255, 255 etc. correct? I attached the code from the VB6 example that I modified from Al Williams code for his example to use with his PakV SX28 chip. I just basically have the serial code setup so when the sliders are changed it automatically sends un update to the SX. Everything that is commented is just the old code. I haven't ried this as I am waiting on a 20mhz resonator. [code] 'Dim SX28Cmd(15) As Integer Private Sub Adjust_Change(Index As Integer) SetVolt Index End Sub Private Sub SetVolt(Index As Integer) 'Dim cmd As Integer Dim duty As Integer Dim voltage As Single 'cmd = SX28Cmd(Index) 'duty = -Adjust(Index).Value 'voltage = 5# * duty / 256# Dim o$ 'will hold 16 consecutive value bytes Dim i% For i = 0 To 15 duty = -Adjust(i).Value voltage = 5# * duty / 256# o$ = o$ + Chr$(duty) Volt(i) = Format(voltage, "0.0") Next If MSComm1.PortOpen = True Then MSComm1.Output = "!PWM" + o$ 'Else 'Beep End If 'Volt(Index) = Format(voltage, "0.0") End Sub Private Sub Adjust_Scroll(Index As Integer) SetVolt Index End Sub Private Sub CloseBtn_Click() End End Sub Private Sub Combo1_Change() BreakConnect MSComm1.CommPort = Combo1.ItemData(Combo1.Index) End Sub Private Sub MakeConnect() Dim i As Integer On Error Resume Next MSComm1.PortOpen = True Connect.Caption = "&Disconnect" MSComm1.Output = Chr(&H85) For i = 0 To 15 SetVolt (i) Next End Sub Private Sub BreakConnect() On Error Resume Next MSComm1.PortOpen = False Connect.Caption = "Co&nnect" End Sub Private Sub Combo1_Click() BreakConnect MSComm1.CommPort = Combo1.ItemData(Combo1.ListIndex) End Sub Private Sub Command1_Click() Debug.Print MSComm1.CommPort; ", "; MSComm1.Settings End Sub Private Sub Connect_Click() If Connect.Caption = "Co&nnect" Then MakeConnect Else BreakConnect End If End Sub Private Sub Form_Load() 'Dim i As Integer 'Dim v As Integer 'v = &H21 'For i = 0 To 15 'SX28Cmd(i) = v 'v = v + 2 'Next End Sub Thanks, Kevin ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=254111#m257818 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)