Go Down

Topic: quick question: Ways to call functions from mai loop (Read 647 times) previous topic - next topic

Bebbetufs

I can't find this in the reference section, or I'm just to green to know what to look for. I want to call an object (function from the main loop)
something like:
Code: [Select]
if viewState == 1 {call function mainView()}

mainView is not supposed to return any values, but simply print text and values to the LCD.
should i use a void for this?


RuggedCircuits

Code: [Select]

void mainView(void) {
  // do whatever
}

void loop(void) {

  ....

  if (viewState == 1) {
    mainView();
  }

  ....
}


--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy