How to analog value increase

Please help me...

i connected my device through the 'Serial Port' and first project light on or off easily done.

how i dimm lights with 'trackr bar value' in visual studio here my code... which is not correctly work

volatile int i=0;

void setup() { Serial.begin(9600); pinMode(2, OUTPUT);

}

void loop() {

if (Serial.available() > 0)

{

int incoming = Serial.read();

incoming = i; analogWrite(2, i);

delay(10); }

Please read this:- How to use this forum It will help you pose a question that can be answered and tell you how to post code.

int incoming = Serial.read();

   
     incoming = i;

Read something (probably incorrectly) from the serial port. Then throw it away, by assigning the variable a constant value. Then wonder why sending serial data doesn't do anything. Well, it seems perfectly obvious to me.