Pages: [1]   Go Down
Author Topic: Tons of Compile Errors  (Read 435 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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);
 

}



* Screen Shot 2012-07-26 at 2.30.52 PM.png (105.13 KB, 849x592 - viewed 8 times.)
Logged

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No let me look...LOL Sorry
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: