from arduino code to C-code (pseudocode?) help please

can someone maybe convert this arduino code for us? :slight_smile:
will save some time <3

stoplicht.ino (795 Bytes)

After removing the code that deals with switches and LEDs, which C does not have, what you are left with is:

const int ledrood = 22;
const int ledgeel = 24;
const int ledgroen = 26;
const int ledintern = 13; 

boolean buttonpressed;

void setup() {
}

void loop() {

if (buttonpressed == HIGH){
  delay(5000);
  delay(1000);
 }

else{
 }

}

Which is straight C code.

You're welcome.

I actually meant something else. I misunderstood something. We need a pseudo code, not a C-code. Still thanks though!

(deleted)

Looks like someone has some code for an assignment but they need to document it and don't understand what it does. The code is so trivial, it is hard to imagine why you can't figure it out yourself. It's also hard to figure out why you couldn't have posted the code inline in code tags (How to post code properly). But to expand on what @spycatcher2k has explained, here's my more detailed pseudo-code: while a button is (or is NOT) pressed, flash some pretty LEDs.

Pete

Brammosz:
can someone maybe convert this arduino code for us? :slight_smile:
will save some time <3

Save whose time?

We are working on some simple school project but we also needed to write an essay in a short time so i thought why not post it on here to save some time

Unbelievable! So, you doing your own work on an assignment to possibly LEARN something is a "waste of your time"!!!

(deleted)

He's lucky we aren't mean. We should have given him a totally wrong answer.

Brammosz: We are working on some simple school project but we also needed to write an essay in a short time so i thought why not post it on here to save some time

Read as:

We are working on a SCHOOL project that needs an essay written in short time. I figured why not ask someone else to do it for me!?? Is this a joke? (am I on camera?) :)