-3
int k ;
int q ;
int f;//pot

void setup() {
  pinMode(k, OUTPUT);
  pinMode(q, OUTPUT);
  pinMode(f, INPUT);
}
void loop() {
  zzf();
}

void gf()
{
  int a = f;//test the conditions of f and store in new variable int a
  if (a == 80)//if a reads 80 then increment a by 1
  {
    ei();//run the ei() function
  }
}

void ei() {
  int k = 3;
  int a = Serial.read();
  {
    digitalWrite(k, a);
  }
}

void zzf() {
  for (f = 0; f < 80; f++) {
    analogWrite(q, f);
  }
}

closed as unclear what you're asking by RSM, Nick Gammon Mar 3 '16 at 20:55

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • You have now changed your question, but I'll give you a hint. Learn C first. Then look carefully at the errors. They are telling you exactly what is wrong; a little bit of searching through StackOverflow will help you immensely. – uint128_t Feb 29 '16 at 20:58
  • 4
    And may I suggest to give understandable names to functions? Maybe to you they are so meaningful, but I bet that if you'll read this sketch in a week you won't understand it at all. It's just an advice :) – FrAxl93 Feb 29 '16 at 21:06
  • A practice in writing gibberish? What's the problem with giving functions good names? – Nick Gammon Mar 1 '16 at 6:03
  • Which is the question? – fabrosell Mar 1 '16 at 13:34
  • 2
    @jai Insulting and other vulgarities are not tolerated on Stack Exchange. – Avamander Mar 2 '16 at 13:55
5

Lean the proper C syntax. This is completely wrong:

void gf()
int a = f;//test the conditions of f and store in new variable int a
{

And this is just as wrong for the same reasons:

void ei()
int k = 3
int a = Serial.read();
{digitalWrite(k, a);}
  • 1
    Majenko is right. The { comes after the function name and arguments, not a few lines further on. – Nick Gammon Feb 29 '16 at 19:42
  • @Majenko telling me what i did wrong does not contributes towards the help, the ide debugger already tells me that theres is something wrong and thats what im looking for help on here – jai Feb 29 '16 at 20:38
  • 1
    And I have told you that your syntax is wrong and that you need to learn the right syntax. Look at your code and then look at someone else's code and spot the difference. That way you will learn. – Majenko Feb 29 '16 at 20:41
  • @NickGammon thank you for being helpful, im not sure why this guy just dint lead of with you very simple approach of helping. i did noticed not what i was missing i was stuck on the fact that i had already used those brackets but i failed to see how i forgot to initialize for the function itself – jai Feb 29 '16 at 20:41
  • 1
    @jai You've been so busy arguing about the answer that you haven't actually learned anything, have you? Look at your ei() function and tell me what is wrong with it. – Majenko Feb 29 '16 at 20:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.