[ create a new paste ] login | about

Link: http://codepad.org/Pmi01lp4    [ raw code | output | fork ]

C, pasted on Jul 31:
#include <Servo.h>
const int buttonPin = 2;  
const int buttonPin1 = 3; 
Servo myServo;  
int buttonState = 0;    
int buttonState1 = 0; 

void setup()

            {
  myServo.attach(9);
  pinMode(buttonPin, INPUT);    
  pinMode(buttonPin1, INPUT);    
             }

void loop() 

{

    buttonState = digitalRead(buttonPin);
    buttonState1 = digitalRead(buttonPin1);

        if (buttonState == HIGH) {     
            myServo.write(150);
           
      } 
        if(buttonState1 == HIGH) {     
            myServo.write(1900);
      }
      
}


Output:
1
2
3
4
5
6
7
8
9
10
Line 18: error: Servo.h: No such file or directory
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'myServo'
In function 'setup':
Line 12: error: 'myServo' undeclared (first use in this function)
Line 12: error: (Each undeclared identifier is reported only once
Line 12: error: for each function it appears in.)
Line 13: error: 'INPUT' undeclared (first use in this function)
In function 'loop':
Line 24: error: 'HIGH' undeclared (first use in this function)
Line 25: error: 'myServo' undeclared (first use in this function)


Create a new paste based on this one


Comments: