Jump to content

How to do it in processing?

How to make the weather program work normally and time to count down?

If you need something, paste the code into the processing program.

 

 

Spoiler

  

int sekundy,minuty,godziny;
float y=100;
void setup()
  {
    size(800,800);
    textSize(70);
    frameRate(30);
    noStroke();
    
    
    
    
   
  }
  
  void draw()
  {
    background(255,255,255);
    fill(255,255,0);
    
                                       ellipse(700,100,100,100);
    text(godziny + ":" + minuty + ":" + sekundy,300,50);
    fill(255,0,255);
    fill(0,0,0);
    
    
    
    
    if(godziny>1)
 {
   background(0,255,255);
   fill(#33cc33);
   ellipse(100,y+23,20,20);
   ellipse(200,y+27,20,20);
   ellipse(300,y+80,20,20);
   
   ellipse(500,y+5,20,20);
   ellipse(700,y+30,20,200);
   ellipse(400,y+40,20,20);
   ellipse(800,y+20,20,20);
   ellipse(600,y+5,20,20);
   ellipse(0,y,20,200);
   ellipse(100,y+130,20,20);
   ellipse(200,y+150,20,20);
   ellipse(300,y+180,20,20);
   
 
 
   ellipse(500,y+5,20,20);
   ellipse(700,y+30,20,20);
   ellipse(400,y+50,20,20);
   ellipse(800,y+20,20,20);
   ellipse(600,y+5,20,20);
   ellipse(0,y,20,20);
   
   if (y > 800)
   {
      y = 0;
      
   }
   
   
   
   
    }
       if(godziny<1)
    {
  
  
 
     fill(#00cc00);
    ellipse(100,y+23,20,20);
    ellipse(200,y+27,20,20);
    ellipse(300,y+80,20,20);
    
    
    
    ellipse(500,y+5,20,20);
    ellipse(700,y+30,20,20);
    ellipse(400,y+50,20,20);
    ellipse(800,y+20,20,200);
    ellipse(600,y+5,20,20);
    ellipse(0,y,20,20);
    
    
    if (y > 800)
    {
       y = 0;
       
    }
    
    
    }
    
    if (sekundy>60)
    {
      minuty=minuty+1;
      sekundy=0;
    }
    if(minuty>59)
    {
      minuty=0;
      godziny=godziny+1;
    }
    
       if(godziny>1)
    {
      
      fill(#009900);
      ellipse(200,100,100,100);
      
    }
    
    y = y + 1;
    
    
  } 

 

sketch_1.pde

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, GamerGry123 said:

How to make the weather program work normally and time to count down?

If you need something, paste the code into the processing program.

If we need something you're supposed to tell us. What does "work normally" mean? Describe what your program is supposed to do, and the problems you are encountering. What issues are you having? Is the code not compiling/running at all? Is it throwing errors? Does it not logically do what you expect? You wrote the code, you are the one who knows what is supposed to happen. We can only help if you explain what is wrong.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, tikker said:

Jeśli potrzebujemy czegoś, co masz nam powiedzieć. Co oznacza „normalna praca”? Opisz, co ma robić Twój program i jakie problemy napotykasz. Jakie masz problemy? Czy kod w ogóle się nie kompiluje / nie działa? Czy wyrzuca błędy? Czy logicznie nie robi tego, czego oczekujesz? Napisałeś kod, jesteś tym, który wie, co ma się wydarzyć. Możemy pomóc tylko wtedy, gdy wyjaśnisz, co jest nie tak.

I wrote earlier that time does not count down.

Link to comment
Share on other sites

Link to post
Share on other sites

20 hours ago, GamerGry123 said:

I wrote earlier that time does not count down.

The code you posted in the spoiler doesn't seem to have anything related to counting down. The only thing related to time that I see is

    if (sekundy>60)
    {
      minuty=minuty+1;
      sekundy=0;
    }
    if(minuty>59)
    {
      minuty=0;
      godziny=godziny+1;
    }
    
       if(godziny>1)
    {
      
      fill(#009900);
      ellipse(200,100,100,100);
      
    }

and there you only count up?

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, tikker said:

The code you posted in the spoiler doesn't seem to have anything related to counting down. The only thing related to time that I see is


    if (sekundy>60)
    {
      minuty=minuty+1;
      sekundy=0;
    }
    if(minuty>59)
    {
      minuty=0;
      godziny=godziny+1;
    }
    
       if(godziny>1)
    {
      
      fill(#009900);
      ellipse(200,100,100,100);
      
    }

and there you only count up?

I do not count there, only time is to count down in this program and it does not work.

Link to comment
Share on other sites

Link to post
Share on other sites

57 minutes ago, GamerGry123 said:

I do not count there, only time is to count down in this program and it does not work.

I don't understand. Your code doesn't do what you want, because you don't have the code that does that. First of all to count down you'll need to subtract somewhere, or use some sort of timer. Secondly nothing in that piece of code seems to really count. You only add 1 minute if the seconds exceed 60 and an hour if the minutes exceed 60, but nowhere do you count seconds.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

22 hours ago, tikker said:

I don't understand. Your code doesn't do what you want, because you don't have the code that does that. First of all to count down you'll need to subtract somewhere, or use some sort of timer. Secondly nothing in that piece of code seems to really count. You only add 1 minute if the seconds exceed 60 and an hour if the minutes exceed 60, but nowhere do you count seconds.

Well, it's about making it count.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×