Controlling multiple Arduino pins in VB or C#? Answered


Author Options:

How do I control different pins of an Arduino via VB or C#. Something simple, for instance; if I created 4 buttons. Button 1 would turn ON pin 13, button 2 would turn OFF pin 13. Button 3 would turn ON pin 12 and button 4 would OFF pin 12. I know that it works via a serial port, but I can only control 1 pin. Simple stuff, but I just can't figure it out. PLEASE HELP!!!!


Send a character. Decode the character. If the character is a "A" Turn on Pin 13, if its a "B" turn on Pin 12. Wait for next character. If character is an "A" Turn off pin 13 etc etc.


make an array in Arduino with the contents holding the pin numbers of outputs you want to change. On the VB side, send two characters - the first being the index number (0,1,2...etc) and the second a T or an F. On the arduino side receive the two characters and use the index to find which pin to change and the T/F to turn it on or off

Show your code so far.

Otherwise I think you confused pin numbers with port numbers,
give it a good look see.