I have the ardunio uno and im trying to send values back and fourth between pc and arduino. I'm using chars and it does seem very efficient are there other ways to do this. Please note that i would like to stay away from processing.
Well you could use Hex representation instead of Chars
Something like this
Private Sub slave2FunctionB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FunctionA.Click
Dim Buffer(7) As Byte
Buffer(0) = &H1
Buffer(1) = &H2
Buffer(2) = &H42
Buffer(3) = &H10
Buffer(4) = &HD
Buffer(5) = &H12
Buffer(6) = &H13
Buffer(7) = &H13
SerialPort1.Write(Buffer, 0, 8) 'buffer array ,0,array size
End Sub
im trying to send values back and fourth between pc and arduino.
Values? Could you maybe be just a teensy bit more specific? What hind of values? How many values? How often?
If you are sending one byte per month, you hardly need to work on improving the efficiency. If you are sending 12,000 floats per second, you probably do.
recognize:
I'm using chars and it does seem very efficient are there other ways to do this.
I guess you mean inefficient. Do you have a performance problem with your current text-based system?
There are more efficient encoding systems, but there are cons to these as well as pros. Text-based systems have the advantage that they are easy to debug and also easy to make tolerably reliable, so don't jump to a more concise encoding system just for the sake of it.
PeterH:
recognize:
I'm using chars and it does seem very efficient are there other ways to do this.I guess you mean inefficient. Do you have a performance problem with your current text-based system?
There are more efficient encoding systems, but there are cons to these as well as pros. Text-based systems have the advantage that they are easy to debug and also easy to make tolerably reliable, so don't jump to a more concise encoding system just for the sake of it.
Im sending about 10-20 every second but for example say I wanted to send the number 1000 how can i do that. I was having performance issues but i fixed it was an error on my part. I'm trying to control shift a couple shift registered and two digital potentiometers that are hooked up to an xbox controller. What alternatives do i have besides sending chars?
Im sending about 10-20 every second
Ten to twenty elephants? Pairs of jeans?
What alternatives do i have besides sending chars?
Using the write() methods to send data in binary format (one byte at a time). Though I don't know how you convert an elephant or pair of jeans to bytes.