Update the second text

I need Help i would update the second Text can everyone help me

Text:

int sekunde = second();
int minute = minute();
int stunde = hour();
int tag = day();
int monat = month(); 
int yahr = year();

void setup(){
  fullScreen();
  background(0);
  frameRate(90);
  textSize(200);
  String s = String.valueOf(tag);
  text(s, 750, 450);
  text(".", 850, 450);
  s = String.valueOf(monat);
  text(s, 900, 450);
  text(".", 1000, 450);
  s = String.valueOf(yahr);
  text(s, 1050, 450);
  textSize(90);
  s = String.valueOf(sekunde);
  text(s, 750, 520);
  orientation(LANDSCAPE);
}
1 Like

I guess you will need to put the code in the draw() function with second() included

1 Like

Unfortunately it does not work

1 Like

Hello,

Please format your code:
https://discourse.processing.org/faq#format-your-code

setup() only runs once:
https://processing.org/reference/setup_.html
The reference above also has related items such as draw()

Additional references:
https://processing.org/
https://processing.org/tutorials/overview/

:)

1 Like

It does work if you put the code in draw() as @noel suggested.

You will have to put the correct code on draw().

Another reference:
https://processing.org/examples/variablescope.html

:)

1 Like

Ist work Thanks​:heart::heart::heart::smiley::smiley::smiley::smiley:

1 Like

Why is now the time not working?

int start = 0;
int sekunde;
int minute;
int stunde;
int tag;
int monat;
int yahr;

void update(){
  sekunde = second();
  minute = minute();
  stunde = hour();
  tag = day();
  monat = month();
  yahr = year();
}

void setup(){
  fullScreen();
  frameRate(90);
}
  
void draw(){
  if(start == 0){
    background(255);
    delay(2000);
    start = 1;
  if(start == 1){
    background(0);
    update();
    textSize(200);
    String s = String.valueOf(tag);
    fill(#FFFFFF);
    update();
    text(s, 750, 450);
    text(".", 850, 450);
    s = String.valueOf(monat);
    update();
    text(s, 900, 450);
    text(".", 1000, 450);
    s = String.valueOf(yahr);
    update();
    text(s, 1050, 450);
    textSize(75);
    s = String.valueOf(sekunde);
    update();
    text(":", 1157, 595);
    text(s, 1175, 600);
    s = String.valueOf(minute);
    update();
    text(s, 1075, 600);
    text(":", 1055, 595);
    s = String.valueOf(stunde);
    update();
    text(s, 975, 600);
    update();
    orientation(LANDSCAPE);
    }
  }
}
1 Like

That is an easy one!

Please format your code and I will consider assisting further.

2 Likes

I have changed the text

1 Like

You have an if statement inside of an if so the condition of 1 is set but on next pass it only checks for a 0.

You should have 2 if statements or an if else.

:)

1 Like

I habe fix that thanks for you help

2 Likes