Arduino and vb (vb receives values from the arduino)

Hi everyone,

I have two problems: 1) I am not able to write a code in arduino which will do the following work: we have two buttons, we press the first button the amount of time that we want. Once the second button is pressed, the program should tell us how many times the first button has been pressed before. 2) Send those values to a textbox in visual basic.

I dont know how to do the communication between an arduino and vb, and i need help to write the arduino code. Thank you all

I am not able to write a code in arduino which will do the following work: we have two buttons, we press the first button the amount of time that we want. Once the second button is pressed, the program should tell us how many times the first button has been pressed before.

Do you know how to do something if a button is pressed ?
Do you know how to add 1 to a variable ?

I dont know how to do the communication between an arduino and vb

Serial.println(count);

Now over to you to write the VB code to receive it.

to add one to a variable i guess i am supposed to use a counter. But how to write the code for the second button. Once the second button is pressed, i should be able to know how many times the first button was pressed before.

Moussou:
i should be able to know how many times the first button was pressed before.

UKHeliBob:

Serial.println(count);

Was this too subtle for you?

I am not too good at arduino and visual basic. Thats the reason why i got confused with the previous answer. Thanks for helping. Any idea about the Vb part?

Moussou: I am not too good at arduino and visual basic. Thats the reason why i got confused with the previous answer. Thanks for helping. Any idea about the Vb part?

Dim number as integer = 0
Try
  Dim message As String = _serialPort.ReadLine()
  number = Int32.Parse(message)
End Try

thank you so much :)