Loading...
  Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 13
61  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 23, 2012, 11:28:18 am
Try this... start a new project in the VB IDE. Create a form and put a VB com control component on it. open the code window and paste the following code into it. be sure and change the com port to the one the Arduino is using. Make sure you have the Arduino IDE closed or the VB app will not connect.

open the immediate window in the VB IDE

This is the simplest possible case. If should work if you are sending a string with a @ in it .


Code:
Private Sub Form_Load()
With MSComm1
        If .PortOpen Then .PortOpen = False
        ' change this to the com port shown by the arduino
        .CommPort = 3
        .Settings = "9600,N,8,1"
        .DTREnable = True
        .RTSEnable = True
        .RThreshold = 4
        .SThreshold = 3
        .PortOpen = True
  End With

End Sub

Private Sub MSComm1_OnComm()
Dim strData As String
Static strBuffer As String
Dim strWords() As String
Dim intPos As Integer
Dim boComplete As Boolean
Dim mystr As String


 

        mystr = "" ' set the string to nothing
        mystr = MSComm1.Input
     
 
            intPos = InStr(mystr, "@")
            If intPos > 0 Then
            Debug.Print mystr
           End If
             
End Sub


62  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 22, 2012, 07:44:38 pm
Quote
Re: Arduino LM335 and visual basic 6

Yes it is written for VB6... isn't that what you are using?
63  Community / Bar Sport / Re: Not TRYING to start a flame war honest. on: August 21, 2012, 10:29:12 am
Quote
Re: Not TRYING to start a flame war honest.

How we doing so far?
64  Using Arduino / Sensors / Re: voltage divider with max31855 vs level shifter on: August 20, 2012, 05:23:12 pm
Thanks CrossRoads. I am sampling with a 20 ms delay . I have not trapped any anomalous reading in a five hour run so this will probably be OK.
65  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 20, 2012, 03:57:32 pm
the Arduino code is ok. I ran it and it showed the correct values in my VB program, so it's coming across the USB ok
Here is the code I use to find the correct com port. It cycles through until it finds a com port sending out the correct string
you will have to declare some of the variables to get it running, but it
stick some debug.print statements in the code and step through it. You should be getting values comming over if the baud rate is set correctly
also, you need to put the VB side read insome kind of loop also so it will keep reading the input

Code:
For n = 1 To 16 ' com ports
  ' close any open ports
  If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
   On Error Resume Next
   MSComm1.CommPort = n
   On Error Resume Next
   MSComm1.InputLen = 0
   MSComm1.PortOpen = True
   If MSComm1.CommID > 0 Then
     For i = 1 To 100 ' keep looking
      str = ""
      str = MSComm1.Input
      ' finds the port sending out the correct string.
      If InStr(str, "Tmp") > 0 And InStr(str, "@") > 0 Then GoTo jump:
      Sleep 50
     Next i
  End If
Next n
jump:

66  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino LM335 and visual basic 6 on: August 20, 2012, 02:12:26 pm
This works for me. You should be able to modify it to get what you want.
Code:
Function TempNow() As Single
Dim str As String
Dim strt, fin, ct As Integer
Dim tempstr As String
Dim u As Single
Dim i, B  As Integer
u = 0
str = ""
For i = 1 To 5
Sleep 10
 str = MSComm1.Input
' I use "Tmp and "@" instead of "<" and ">"
 If InStr(str, "Tmp") > 0 And InStr(str, "@") > 0 Then
   GoTo J1
 End If
Next i

J1:
ct = 0
u = 0
 
  strt = InStr(str, "@-") + 2
  fin = InStr(str, "-Tmp")
  If (fin - strt) <= 0 Then
   Exit Function
  Else
   ct = ct + 1
   u = u + Mid(str, strt, (fin - strt))
 End If
 TempNow = u / ct
 If Option1.Value = True Then
    TempNow = TempNow * (9 / 5) + 32
 End If
End Function
67  Using Arduino / Sensors / voltage divider with max31855 vs level shifter on: August 20, 2012, 01:47:47 pm
In many of the articles on how to interface the max31855 chip with the Arduino, it recommends using a level shifter to get the right voltage.
I created a voltage divider with series 10K and 22K resistors between the Arduino input pins and ground and pulled the signal off at the junction.

This seems to work just fine so far. Am I missing something here? Why use an expensive IC if two 1/8 watt resistors seem to work just as well?
68  Using Arduino / General Electronics / Re: Uses for these sensors? on: August 13, 2012, 08:34:19 pm
WOW! I want my parents to send me that! 

The types of shields/sensors are listed below the picture... looks like you can do darn near anything with that assortment. You will have to dig through then Arduino  site to find out how to use them. There are lots of tutorials and scripts on many of these.


Pick out one that make sense to you and start from there... I assume you have an arduino board.

69  Using Arduino / General Electronics / Re: New to electronics stuck on motor on: August 13, 2012, 08:28:00 pm
is it a simple two wire motor? Did you set the pin 11 as OUTPUT in the setup?  Be careful of hooking up any motor directly to a pin. It might burn it out. Test your circuit with an LED first with a 220 ohm resistor soldered to it.
70  Using Arduino / Microcontrollers / Re: Inconsistent A/D conversion on: August 09, 2012, 06:18:01 pm
Quote
Do you mind not hijacking my thread.
sorry...just asking, thought it might be important to know even for you.
71  Using Arduino / Microcontrollers / Re: Inconsistent A/D conversion on: August 09, 2012, 01:50:44 pm
Quote
Try making 2 readings in a row, and use the 2nd reading, see if that gives better results.
This gives the internal sample & hold circuit a chance to stabilize for the 2nd reading.

should there be a delay between the two readings... if so what would the minimum delay be to allow stabalization?
72  Topics / Interactive Art / Re: vacuum plate idea on: August 06, 2012, 09:22:26 am
Quote
You could do what the LumiDisk seems to do: fill the gap with glass beads.

I agree with John. Under high vacuum, plastics tend to gas out monomers and plasticizers that contaminate the inert atmosphere.
73  Using Arduino / Microcontrollers / Re: multiple ATMEGA328 chips on the same crystal on: August 04, 2012, 04:54:31 pm
I think I'll stick with CrossRoads. My idea was to have one chip monitoring all of the sensors and sending the info to the second chip that would process the data and do logging and control functions. Of course there will be two different programs running on each chip, so the hex aint going to be the same. Sounds like I can do this much, but can't expect an accurate timing sync between them.
Quote
There is 4ms delay, right? The delay probably comes from the Start-up time xx CK/ 14 CK + yy ms, try setting with lowest xx and 0ms.
does this mean that if the first thing you did in setup()on both boards was get the millis() that I would be max off by about 4Ms?
74  Using Arduino / Microcontrollers / multiple ATMEGA328 chips on the same crystal on: August 03, 2012, 06:49:20 pm
I am thinking of a project with 2-3 ATMEGA328 chips tied in parallel  with a single 16 MHz crystal for all.

The question is,  will this work and will they all clock synchronously so that their output/input pins will track the same clock cycle??

Has anyone tried this?
75  Using Arduino / Sensors / Re: Digital & analog read disagrees with meter on: August 01, 2012, 11:48:25 am
Is the sensor well connected to the common ground with board?
Pages: 1 ... 3 4 [5] 6 7 ... 13