Hi,
I have created a program to get a value. This is my program code.
When i typed these codes, i have an error message saying that "cannot implicitly convert type 'System.Collect ions.ArrayList' to 'byte"
then when i need to use
when i put the getValue method on the data received event, i have another error saying that "No overload for method 'getValue' takes '0' arguements
Can anyone help me on this?
I have created a program to get a value. This is my program code.
Code:
private byte getValue (byte[]ComBuffer)
{
ArrayList list = new ArrayList();
int intVal=0;
for (intVal=0; intVal<129; intVal++)
{
list.Add(ComBuffer[intVal+1]);
}
return list;
}
then when i need to use
Code:
void DataReceived(object sender, SerialDataReceivedEventArgs e)
{
int bytes = comPort.BytesToRead;
byte[] comBuffer = new byte[bytes];
comPort.Read(comBuffer, 0, bytes);
getValue();
}
Can anyone help me on this?
Comment