# Interface arduino with C#

**URL:** <https://forum.arduino.cc/t/interface-arduino-with-c/7050>\
**Category:** News\
**Created:** [June 17, 2010, 6:21pm UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050 "2010-06-17T18:21:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 17, 2010, 6:21pm UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050/1 "2010-06-17T18:21:01Z")

</div>

Hi, I'm using C# to send values to my arduino such as 12 and 24 to my arduino. I've got the coding were my arduino reads 12 if i send \<12\> from C# and when i send \* an infinte for loop is activated. Now I got the infinite for loop to go from 0 to 15 and start again from 0 to 15 and this will keep on going until the arduino is switched on.

my infite for loop  
for (int b = 0; b\<17; b++)  
{  
look what is the value of serialValue  
\*\* and do something\*\*  
**}**  
**I did this infinite for loop because i'm storing the C# values on the ardunio, which are then stored in an array called serialValues\_\_, and when i send \* from C# the infinte loop starts.\_\_**  
**As explaind i want the arduino to go through all the values it received and if it receives 12 and pin 10 is high then pin 12 is high etc..**  
**the problem i'm facing is that when the infite loop starts again from 0 and the value 12 reappeard from the array and pin 10 is low, pin 12 remains high and i want it to go LOW. And when b starts from 0 again and pin 10 is high i want pin12 u go high again**  
**HERE is my coding I would appreciate any help cause i'm a college student and i need to solve this problme ASAP**  
**#**

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 29, 2010, 3:34am UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050/2 "2010-06-29T03:34:11Z")

</div>

First of all your for loop by itself is not infinite, unless placed inside another loop. Also the way that it is setup now it goes from 0 to 16 not 15.

if you post your code with a better explanation of what you are trying to do we might be able to help

---

<div class="post-metadata">

**Author:** ![bld](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/bld/32/213882_2.png) [@bld](https://forum.arduino.cc/u/bld)\
**Post date:** [July 2, 2010, 9:21am UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050/3 "2010-07-02T09:21:54Z")

</div>

inf loop would just be a

while(true) {}

or

for (;😉 {}

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 2, 2010, 1:00pm UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050/4 "2010-07-02T13:00:28Z")

</div>

Haha, part of your for loop showed up as a smiley!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 6:39pm UTC](https://forum.arduino.cc/t/interface-arduino-with-c/7050/5 "2021-05-06T18:39:32Z")

</div>

Closed on May 6, 2021, 6:39pm UTC


