user23611: I'm trying to proportion potentiometer value to analog pin value. Like 1024 to 255.
int readVolumePot() {
    int val = analogRead(potVolumePIN);

    Serial.print("VOL");
      Serial.println((val * 255/1024));

      return (val * 255/1024);
  }

As potentiometer turns I got irrelevant values.
VOL3
VOL3
VOL3
VOL17
VOL-16
VOL-16
VOL-21
VOL-1
VOL-10
VOL-3
VOL-4
VOL11
VOL8
VOL13
VOL17
VOL15

In Arduino's website they say 

some constant calculations may overflow (e.g. 60 * 1000 will yield a
  negative result).

Notwithstanding, I cannot find an appropriate way to convert the potentiometer value to analog pin value.

user22924: analogRead() returns a number from 0 to 1023, and you want to convert that to a range from 0 to 255? One easy way would be to simply divide the reading by 4.
On a more general note, given that the numbers will (should!) never be negative, there's a flavour of int called unsigned int. By using that:
unsigned int val = analogRead(...);

you can cover a range from 0 to 65535 instead of int's -32768 to 32767. That will give you a little more head room - but not enough to multiply the maximum value 1023 by 255 first.
There's also another type long. That covers the range from -2 to 2 billion (and a bit), while unsigned long goes from 0 to 4 billion (and a bit) - but that uses a LOT of processing for the poor Arduino to work with.

23611: <p>I'm trying to proportion potentiometer value to analog pin value. Like 1024 to 255.</p>

<pre class="lang-cpp prettyprint-override"><code>int readVolumePot() {
    int val = analogRead(potVolumePIN);

    Serial.print("VOL");
      Serial.println((val * 255/1024));

      return (val * 255/1024);
  }
</code></pre>

<p>As potentiometer turns I got irrelevant values.</p>

<pre><code>VOL3
VOL3
VOL3
VOL17
VOL-16
VOL-16
VOL-21
VOL-1
VOL-10
VOL-3
VOL-4
VOL11
VOL8
VOL13
VOL17
VOL15
</code></pre>

<p>In Arduino's <a href="https://www.arduino.cc/en/Reference/Arithmetic" rel="nofollow noreferrer">website</a> they say </p>

<blockquote>
  <p>some constant calculations may overflow (e.g. 60 * 1000 will yield a
  negative result).</p>
</blockquote>

<p>Notwithstanding, I cannot find an appropriate way to convert the potentiometer value to analog pin value.</p>
 22924: <p><code>analogRead()</code> returns a number from <code>0</code> to <code>1023</code>, and you want to convert that to a range from <code>0</code> to <code>255</code>? One easy way would be to simply divide the reading by <code>4</code>.</p>

<p>On a more general note, given that the numbers will (should!) never be negative, there's a flavour of <code>int</code> called <code>unsigned int</code>. By using that:</p>

<pre><code>unsigned int val = analogRead(...);
</code></pre>

<p>you can cover a range from <code>0</code> to <code>65535</code> instead of <code>int</code>'s <code>-32768</code> to <code>32767</code>. That will give you a little more head room - but not enough to multiply the maximum value <code>1023</code> by <code>255</code> first.</p>

<p>There's also another type <code>long</code>. That covers the range from -2 to 2 billion (and a bit), while <code>unsigned long</code> goes from 0 to 4 billion (and a bit) - but that uses a LOT of processing for the poor Arduino to work with.</p>
