fatal error: wiring.h: No such file or directory #include <wiring.h>

This is my receiver code and i am trying to rotate a servo motor using rf module .Please help :confused:

// Include VirtualWire library
#include <VirtualWire.h>
#include <ServoTimer2.h>
//#include

// Pins definition
const int led_pin = 13;
const int receive_pin = 12;
//int pinSpeaker = 10;
int j,pos=0;
// #define degreesToUS( _degrees) (_degrees * 6 + 900)

ServoTimer2 myservo;
void setup()
{
//Serial.begin(9600); // Debugging only
// Initialise the IO and ISR
vw_set_rx_pin(receive_pin);
vw_setup(4000); // Transmission rate
// Start the receiver PLL
vw_rx_start();
// Set LED pin and Buzzer
pinMode(led_pin, OUTPUT);
// pinMode(pinSpeaker, OUTPUT);
myservo.attach(3);
}

void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

// Check if a message was received
if (vw_get_message(buf, &buflen))
{
if(buf[0]==‘1’)
{
//Serial.println(“Motion detected!”);
digitalWrite(led_pin,1);
j=0;

while(j<1)
{
for(pos = 0; pos < 1500; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write((pos)); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 1500; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write((pos)); // tell servo to go to position in variable ‘pos’
delay(15); // waits 15ms for the servo to reach the position
}
j++;
}

// playTone(300, 160);
delay(150);
}
if(buf[0]==‘0’)
{
//Serial.println(“Motion ended!”);
digitalWrite(led_pin,0);
//playTone(0, 0);
delay(300);
}
}
}

// duration in mSecs, frequency in hertz
/*void playTone(long duration, int freq)
{
duration *= 1000;
int period = (1.0 / freq) * 1000000;
long elapsed_time = 0;
while (elapsed_time < duration)
{
digitalWrite(pinSpeaker,HIGH);
delayMicroseconds(period / 2);
digitalWrite(pinSpeaker, LOW);
delayMicroseconds(period / 2);
elapsed_time += (period);
}
}
*/

The subject itself is the error

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Can you please post a copy of your sketch, using code tags?
They are made with the </> icon in the reply Menu.
See section 7 http://forum.arduino.cc/index.php/topic,148850.0.html

Tom… :slight_smile:

Alternatively you could use the Search feature up in the top corner?

This is my code

//#include <Wire.h>

//#include<wiring.h>


// Include VirtualWire library
#include <VirtualWire.h>
#include <ServoTimer2.h> 
//#include 
 
// Pins definition
const int led_pin = 13;
const int receive_pin = 12;
//int pinSpeaker = 10; 
 int j,pos=0;
// #define degreesToUS( _degrees) (_degrees * 6 + 900)
 
ServoTimer2 myservo;
void setup()
{
   //Serial.begin(9600); // Debugging only
   // Initialise the IO and ISR
   vw_set_rx_pin(receive_pin);
   vw_setup(4000); // Transmission rate
   // Start the receiver PLL
   vw_rx_start();
   // Set LED pin and Buzzer
   pinMode(led_pin, OUTPUT);
  // pinMode(pinSpeaker, OUTPUT);
  myservo.attach(3);
}


void loop()
{
   uint8_t buf[VW_MAX_MESSAGE_LEN];
   uint8_t buflen = VW_MAX_MESSAGE_LEN;
 
   // Check if a message was received
    if (vw_get_message(buf, &buflen)) 
    {
      if(buf[0]=='1')
      {
      //Serial.println("Motion detected!");
      digitalWrite(led_pin,1);
      j=0;

while(j<1)
{
  for(pos = 0; pos < 1500; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write((pos));              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  for(pos = 1500; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees 
  {                                
    myservo.write((pos));              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  }
  j++; 
}
      
    //  playTone(300, 160);
      delay(150);
      }  
     if(buf[0]=='0')
     {
     //Serial.println("Motion ended!");
     digitalWrite(led_pin,0);
     //playTone(0, 0);
     delay(300); 
     }
   }
}

// duration in mSecs, frequency in hertz
/*void playTone(long duration, int freq) 
{
    duration *= 1000;
    int period = (1.0 / freq) * 1000000;
    long elapsed_time = 0;
    while (elapsed_time < duration) 
    {
    digitalWrite(pinSpeaker,HIGH);
    delayMicroseconds(period / 2);
    digitalWrite(pinSpeaker, LOW);
    delayMicroseconds(period / 2);
    elapsed_time += (period);
   }
}
*/

The error

C:\Users\Admin\Documents\Arduino\libraries\ServoTimer2\ServoTimer2.cpp:12:20: fatal error: wiring.h: No such file or directory
 #include <wiring.h>
                    ^
compilation terminated.
Error compiling.

My motive is to receive the signals transmitted by the transmitter which will be able to move the motor.Firstly there was a problem of using servo.h and virtualwire.h .Then I used ServoTimer2.h and now I am getting this error.Please help :slight_smile:

Please help

You want us to search for that SAME ERROR MESSAGE for you? The solution you’ll find when you bother to look is to edit the offending file, and change Wiring to Arduino.