title: Arduino (C language) parsing string with delimiter (input through serial interface)
body: <p>Arduino (C language) parsing string with delimiter (input through serial interface)</p>
  
  <p>Didn't find the answer here :/</p>
  
  <p>I want to send to my arduino through a serial interface (Serial.read()) a simple string of three numbers delimited with comma. Those three numbers could be of range 0-255. </p>
  
  <p>Eg. 
  <code>255,255,255</code>
  <code>0,0,0</code>
  <code>1,20,100</code>
  <code>90,200,3</code></p>
  
  <p>What I need to do is to parse this string sent to arduino to three integers (let's say r, g and b).</p>
  
  <p>So when I send 
      100,50,30 
  arduino will translate it to</p>
  
  <pre><code>int r = 100
  int g = 50
  int b = 30
  </code></pre>
  
  <p>I tried lots of codes, but none of them worked. The main problem is to translate string (bunch of chars) to integer. I figured out that there will probably be strtok_r for delimiter purpose, but that's about it.</p>
  
  <p>Thanks for any suggestions :)</p>