Arduino 7Segment <Pot Vault>

Hi genius. Arduino program. How A0 Port reading potentiometer vault respectively 7Seg display.
Ex Pot Vault : 8571 >>> 7 Segment : 8-5-7-1. Im search this program. Can someone help me Please ?
I know just 1-2-3...- 9 program display arduino program but qustion program idk Please Genius. This is my homework and I need to finish school.

And Sorry my launge... THANK YOU

The value read from a pin with a potentiometer connected to it will never exceed 1023.

Extracting the thousands value, the hundreds value, the tens value, and the ones value from an int is trivial.

How you elect to display the 4 values on ONE seven segment display is a mystery that you have to work out.

What have you tried?

I am 100% certain that "go ask someone else to write code for you" is NOT part of the assignment.

Ex ;

So if you have the number 10250 as an integer you can get at each number with:

10250 % 10 = 0
(10250 / 10) % 10 = 5
(10250 / 100) % 10 = 2
(10250 / 1000) % 10 = 0
(10250 / 10000) % 10 = 1 so in order 1 - 0 - 2 - 5 - 0 7 Segment Display

Yes and using a loop to get to the answer will probably get you higher grades.

i waiting this program. ım just 7segment display 1-2-3-4-5-6-7-8-9 show program. i can't this program potentiometer with i don't know how :frowning:

Well if you try and show us what you have we can give you some pointers, still we should not be doing your homework.

we can give you some pointers

Here's one:

char *reply = "We don't do your homework";

But i don't know how to do this and this project will be replaced by the exam. everyone in the class explores how the teacher did not teach us how we stuck. potentiometer will show different values ​​when we increase or decrease it continuously and how to print it automatically in the segment. I'm very confused. If you can show me a sample program that I can use, I can start and run my head.

int a=12,b=11,c=10,d=9,e=8,f=7,g=6;
int number = map(analogRead(A0),0,1023,0,99);
int i= number / 10;
int j= number % 10;

long scaledanalogRead(int pin,long top){
return((analogRead(pin) * (top + 1L)) >> 10);
}

void setup(){
Serial.begin(9600);
pinMode(a,OUTPUT);pinMode(b,OUTPUT);pinMode(c,OUTPUT);pinMode(d,OUTPUT);pinMode(e,OUTPUT);pinMode(f,OUTPUT);pinMode(g,OUTPUT);
}

void loop(){
for(int i=0; i<=1024; i=i++)
for(int j=1024; i>=0; i=i--)
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,1);digitalWrite(e,1);digitalWrite(f,1);digitalWrite(g,0);
delay(200);
digitalWrite(a,0);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,0);digitalWrite(g,0);
delay(200);
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,0);digitalWrite(d,1);digitalWrite(e,0);digitalWrite(f,1);digitalWrite(g,1);
delay(200);
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,1);digitalWrite(e,0);digitalWrite(f,0);digitalWrite(g,1);
delay(200);
digitalWrite(a,0);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,1);digitalWrite(g,1);
delay(200);
digitalWrite(a,1);digitalWrite(b,0);digitalWrite(c,1);digitalWrite(d,1);digitalWrite(e,0);digitalWrite(f,1);digitalWrite(g,1);
delay(200);
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,0);digitalWrite(e,0);digitalWrite(f,0);digitalWrite(g,1);
delay(200);
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,1);digitalWrite(e,1);digitalWrite(f,1);digitalWrite(g,1);
delay(200);
digitalWrite(a,1);digitalWrite(b,1);digitalWrite(c,1);digitalWrite(d,1);digitalWrite(e,0);digitalWrite(f,1);digitalWrite(g,1);
}

I wanted to be able to write this program with resources

for(int i=0; i<=1024; i=i++)

Use "i++" or "i=i+1" or "++i", but never "i=i++"

Please remember to use code tags when posting code

  for(int i=0; i<=1024; i=i++)
  for(int j=1024; i>=0; i=i--)

Why do both loops depend on i?

Why does nothing in the body of the inner loop depend on either i or j?

You don't seem to understand that loop() loops.

I think I stopped doing that. someone in the class could not. the teacher had to explain first about it.