Go Down

Topic: Wprogram.h PROBLEM (Read 1 time) previous topic - next topic

bossDELIZO

Good day sirs, i used the scheduler library then the error says that this wprogram.h was not found, i dont know what to do, hope you help me guys thank you, this is my program and at the bottom is the error, thank you in advance

#include <Scheduler.h>


const int conveyorsensor = 2;   
const int conveyorstopper =  22;
const int cylindera =  24;
const int cylinderb =  26;
const int cylsticker = 28;
const int mforward = 30;
const int mreverse = 32;

int consenstate = 0;         // variable for reading the pushbutton status

void setup() {
 
  pinMode(conveyorstopper, OUTPUT);
  pinMode(cylindera, OUTPUT);
  pinMode(cylinderb, OUTPUT);
  pinMode(cylsticker, OUTPUT);
  pinMode(mforward, OUTPUT);
  pinMode(mreverse, OUTPUT);
  pinMode(conveyorsensor, INPUT);

  Scheduler.startLoop(loop2);
}

void loop() {

  consenstate = digitalRead(conveyorsensor);

  digitalWrite(cylsticker, HIGH);
  delay(1000);
  digitalWrite(cylsticker, LOW);
  delay(1000);
  digitalWrite(mforward, HIGH);
  delay(3000);
  digitalWrite(mforward, LOW);
  digitalWrite(cylsticker, HIGH);
  delay(1000);
  digitalWrite(cylsticker, LOW);
  delay(1000);
  digitalWrite(mreverse, HIGH);
  delay(3000);
  digitalWrite(mreverse, LOW);
  exit(0);

}
void loop2(){


  if (consenstate == HIGH) {
   
    digitalWrite(conveyorstopper, HIGH);
    delay(500);
    digitalWrite(conveyorstopper, LOW);
    digitalWrite(cylindera, HIGH);
    digitalWrite(cylinderb, HIGH);
    delay(2000);
    digitalWrite(cylindera, LOW);
    digitalWrite(cylinderb, LOW);
  }
  else {
 
    digitalWrite(conveyorstopper, LOW);
    digitalWrite(cylindera, LOW);
    digitalWrite(cylinderb, LOW);
   
  }
  yield();
}


In file included from C:\Users\user\Documents\Arduino\Labeling_Machine_3\Labeling_Machine_3.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\Scheduler/Scheduler.h:33:22: fatal error: WProgram.h: No such file or directory

 #include <WProgram.h>

                      ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

rpt007

#1
Jan 17, 2017, 10:04 am Last Edit: Jan 17, 2017, 10:07 am by rpt007
Hi and welcome to this forum,

pls use code tags (</>) when you post code next time.
It would also be a good idea to read the forum rules ("How to use this forum"); you find the URL in my signature below.

Your error message:
Apparently you are working with an IDE version > 1.0; "WProgram.h" is no longer supported in newer IDE's (and libraries) and was replaced by "Arduino.h".

So check your library "Scheduler.h" and replace the statement
Code: [Select]
#include <WProgram.h>
with
Code: [Select]
#include <Arduino.h>



Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

bossDELIZO

sorry sir i didnt read the http://forum.arduino.cc/index.php?topic=148996.0 before i posted here, my bad hehehe, btw i do not use wprogram.h or arduino.hin my program, so how did it appear in my the error? i am a newbie in programming so please bear with me, thank you for your responses sirs

septillion

The error clearly shows (and rpt007 told you) that the error is in "Scheduler.h". The outdated library you include :)
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

rpt007

#4
Jan 18, 2017, 01:47 pm Last Edit: Jan 18, 2017, 01:48 pm by rpt007
Quote
btw i do not use wprogram.h or arduino.hin my program, so how did it appear in my the error? i am a newbie in programming
Here is my explanation for you as a newbie:

When you include libraries in your sketch (I suspect you didn't write it yourself, but copied an old sketch which you found somewhere, didn't you?) they will become essential part of your code.

The IDE compiler then looks line by line at the statements and translates into a kind of machine language package, so that the ATMEL processor on board of the Arduino can really understand what it should do next.

In your case it finds the "include" statement pretty soon - and then goes into this library and does the same as with your other code lines. The IDE itself already comes with some included libraries (they are a bit hidden for the normal user, so you don't have to bother with them), but as the IDE gets more and more features, the developers sometimes exchange outdated libraries which then will not be any longer included or supported.

So in your case the IDE can't find the WProgram.h anymore in its included libraries. The newer library is the Arduino.h which comes with all IDE's since version 1.0 or so and that lib functions as the outdated WProgram.h - and therefor it is needed to replace the outdated include statement IN THE SCHEDULER library with the newer one as described above.

If you want to find a more precise and broader information how an Arduino works, what the compiler does etc. have a look at this very interesting thread and even for non-programmers understandable explanations:
http://forum.arduino.cc/index.php?topic=443289.0
Before you ask:
Did you really read and understand How to use this forum ?
AND:
Do you have already some solution or is a part of the problem sitting in front of the screen?  :)

Udaya_Jayantha

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Surajika\Documents\Arduino\libraries\Liquidcrystal440\LiquidCrystal440.cpp:7:22: fatal error: WProgram.h: No such file or directory

#include "WProgram.h"

                     ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

DrAzzy

#6
Jun 14, 2018, 05:02 am Last Edit: Jun 14, 2018, 05:02 am by DrAzzy
Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\Surajika\Documents\Arduino\libraries\Liquidcrystal440\LiquidCrystal440.cpp:7:22: fatal error: WProgram.h: No such file or directory

#include "WProgram.h"

                     ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Replace line 22 of LiquidCrystal440.cpp with #include "Arduino.h"

You may have to do the same in LiquidCrystal440.h

Better yet - consider finding a newer version of that library (or newer library for same hardware) - any one that used WProgram.h is *ancient*. That changed years ago around version 1.0
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up