I want to control brightness of Led with potentiometer and two button .

I’m newbie in programming.
So want it to control it simultaneously with potentiometer and two button but they interrupted each other when they send signal to arduino.

i wrote the first code on the buttons but on the second i just copy the example code for potentiometer.

int ledc = 9; //Led
int pot = A0;//Pot:
int inb = 12;//Increase Button:
int deb = 8;//Decrease Button:

//Variable that change
int brightness = 0;
int buttonState = 0;
int maxbright = 10;
int brightup = 2;
int sensorValue = 0;
int outputValue = 0;

void setup() {
pinMode(ledc, OUTPUT);
pinMode(inb, INPUT);
pinMode(deb, INPUT);
Serial.begin(9600);

}

void loop() {

if (digitalRead(inb) == HIGH && brightness < maxbright ) {
brightness = brightness + brightup;
Serial.println(brightness);
}

if (digitalRead(deb) == HIGH && brightness > 0) {
brightness = brightness - brightup;
Serial.println(brightness);
}
delay(30);

analogWrite(ledc, map(brightness, 0, maxbright, 0, 255));

// read the analog in value:
sensorValue = analogRead(pot);
// map it to the range of the analog out:
outputValue = map(sensorValue, 0, 1023, 0, 255);
// change the analog out value:
analogWrite(ledc, outputValue);

// print the results to the serial monitor:
Serial.print("sensor = “);
Serial.print(sensorValue);
Serial.print(”\t output = ");
Serial.println(outputValue);

// for the analog-to-digital converter to settle
// after the last reading:
delay(100);

}

but they interrupted each other when they send signal to arduino.

And by that, I take it that that is a Bad Thingtm?
What do you want to do?

// wait 2 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(100);

It helps everyone when code and comment agree with each other.

Please get used to using code tags when posting code.

i want to control the led with two input

i want it when i press the increase button to increase the brightness of the led and increase it also in potentiometer.

How do you decide which input to use?
A timeout?

is it possible to store the data preset but when i use the potentiometer i also can use it

Yes, you could use the EEPROM to store settings, but you still need some protocol or control to decide which to use.

int ledc = 9; //Led 

 // read the analog in value:
  sensorValue = analogRead(ledc);

What values do you get when you analog read pin 9?

i see is this
sensor = 217 output = 54
sensor = 233 output = 58
sensor = 223 output = 55
sensor = 209 output = 52
sensor = 215 output = 53
sensor = 212 output = 52
sensor = 209 output = 52
sensor = 231 output = 57

but i cant control the led with the button

Which Arduino board are you using? If an Uno, pin 9 is not an analog input. Do you mean to read the pot on A0?

You are controlling the LED with the buttons, but not for long enough for you to notice.