Go Down

Topic: Tons of Compile Errors (Read 504 times) previous topic - next topic

Scott Portocarrero

After upgrading to Arduino 1.0.1 none of my programs will compile.  There are two libraries I typically use Button & Servo.  I don't understand why nothing will compile.  Do I need to upgrade my libraries also?  See attached image.

Code: [Select]

#include <Servo.h>
#include <Button.h>


/*
ArduKart

This program was written for an Arduino powered GoKart. 

Press GO and the kart with ramp up to top speed
This is done trough PWM to a motor controller
Press REV and the kart will go into reverse with a preset max speed
This is also done through PWM to a motor controller

This shit is pretty dope!!!!!!

*/


Servo leftMotor;
Servo rightMotor;

Button goButton(8,BUTTON_PULLUP);
Button revButton(7,BUTTON_PULLUP);



int goPos = 90;         //puts motor controllers @ 90 degrees (neutral)
int revPos = 90;        //puts motor controllers @ 90 degrees (neutral)
int rampSpeed = 0;      //time it takes to ramp up to full speed



void setup() 
{
  Serial.begin (9600);
  leftMotor.attach(9);      // left motor controller connected to digital pin 9
  rightMotor.attach(10);      // right motor controller connected to digital pin 10


}



void loop() 
{
 

  //delay(100);                      //delay for testing
  if(goButton.isPressed())
  {
    if (goPos < 180) {goPos ++;}
    if (goPos > 180)  {goPos = 180;}
    leftMotor.write(goPos);
    rightMotor.write(goPos);
    delay(rampSpeed);
  }
 
  else
    {
      goPos = 90;
    }
 
 
if(revButton.isPressed())
  {
    if (revPos <= 90) {revPos --;}
    if (revPos < 0)  {revPos = 0;}
    leftMotor.write(revPos);
    rightMotor.write(revPos);
   
  }
 
  else
    {
      revPos = 90;
    }
 
 

 
 
 

   
  Serial.print("Reverse Postion:");
  //Serial.print('\t');
  Serial.print(revPos);
  Serial.print('\n');
 
  Serial.print("Go Position:");
  //Serial.print('\t');
  Serial.print(goPos);


}



Arrch

Do I need to upgrade my libraries also?  See attached image.

Yes.

WizenedEE

Did you happen to read the thread at the top of this forum entitled, "Read this before posting a programming question"?

Scott Portocarrero

No let me look...LOL Sorry

MichaelMeissner


No let me look...LOL Sorry

That being said, it would have been nicer if the Arduino IDE provided a WProgram.h file that included Arduino.h.

Scott Portocarrero

You guys are awesome!!!! Thank you!! 

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy