i'm having an error in compiling my codes. please help, thank you. the error states:
Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
C:\Users\CUTE\Documents\Arduino\libraries\ks0108\ks0108.cpp:33:67: fatal error: wiring.h: No such file or directory
#include <wiring.h> // added 18 Sept 2008 for Arduino release 0012
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
-this is my code.
#include <ArduinoIcon.h>
#include <Arial14.h>
#include <ks0108.h>
#include <ks0108_Arduino.h>
#include <ks0108_Mega.h>
#include <ks0108_Panel.h>
#include <ks0108_Sanguino.h>
#include <SystemFont5x7.h>
// Chip specific includes
#if defined(AVR_ATmega1280)
#include "ks0108_Mega.h" // include this for the Arduino Mega other ATmega1280 boards
#elif defined(AVR_ATmega2560)
#include "ks0108_Mega.h" // include this for the Arduino Mega2560 other ATmega1280 boards
#elif defined (AVR_ATmega644) // TODO - check this define
#include "ks0108_Sanguino.h" // include this for Sanguino or ATmega644 boards
#else
#include "ks0108_Arduino.h" // include this for the Arduino or other ATmega168 boards
#endif
#include "ks0108_Panel.h" // this contains LCD panel specific configuration
// defines pins numbers
#define glcdCSEL1 33 // CS1 Bit
#define glcdCSEL2 34 // CS2 Bit
#define glcdRW 35 // R/W Bit
#define glcdDI 36 // D/I Bit
#define glcdEN 37 // EN Bit
const int trigPin = 40;
const int echoPin = 41;
const int buzzer = 49;
const int ledPin = 51;
// defines variables
long duration;
int distance;
int safetyDistance;
void setup() {
// Initialize the GLCD
GLCD.Init(INVERTED) ;
GLCD.SetFontColor( BLACK);
GLCD.ClearScreen();
GLCD.CursorToXY( 1,5);
GLCD. print("distance:") ;
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(buzzer, OUTPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance = (duration * 0.034 / 2);
safetyDistance = distance;
if (safetyDistance <= 5) {
digitalWrite(buzzer, HIGH);
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(buzzer, LOW);
digitalWrite(ledPin, LOW);
}
GLCD.CursorToXY( 1,16);
GLCD. print(distance);
}