Servo.h missing

I am using a PCduino to run a sketch that is known to work on a standalone Arduino, seeing as I have received zero replies on their forum I figured I would see what the Arduino community could assist with.

I received the PCduino as a free instructables price but so far it seems kinda dumb.

When I upload the following code directly on the PCduino it says servo.h is missing. I did download SoftwareServo.h and included it and it did nothing (like I thought)

Any ideas on working with this thing?

//======================================
//Circle Math
//======================================
#include <math.h>

#define pi    3.14159265358979323846
#define twopi (2*pi)
float circleradius = 50; //50 each side - make no more any of your max limit values
float stepnumber = 360;
float stepangle;
//======================================


#include <Servo.h> //include servo library for servo control 

Servo horServo; //servo for left/right movement
Servo vertServo; //servo for up/down movement

byte randomhor; //define random horizontal position variable
byte randomvert; //define random vertical position variable
int randomdelay; //define random delay variable

#define HLEFTLIMIT 20 //define left limit on horizontal (left/right) servo
#define HRIGHTLIMIT 80 //define right limit on horizontal (left/right) servo

#define VTOPLIMIT 0//define top limit on vertical (up/down) servo
#define VBOTLIMIT 110 //define bottom limit on horizontal (up/down) servo


void setup() 
{ 
  horServo.attach(8); //horizontal servo on pin 8
  vertServo.attach(9); //vertical servo on pin 9
  randomSeed(analogRead(0)); //Create some random values using an unconnected analog pin


  //=====================================================
  //Roll Eyes :D
  //=====================================================
  stepangle = twopi/stepnumber;
  for(int i = 0; i<stepnumber; i++){
    float angle = i*stepangle;
    float x = sin(angle)*circleradius;
    float y = cos(angle)*circleradius;

    x = map(x, 1-circleradius, circleradius, 0, 2*circleradius);
    y = map(y, 1-circleradius, circleradius, 0, 2*circleradius);

    horServo.write(x); //write to the horizontal servo
    vertServo.write(y); //write to the horizontal servo

    delay(10);
  }
  //=====================================================
} 


void loop() 
{ 
  randomhor = random(HLEFTLIMIT, HRIGHTLIMIT); //set limits
  randomvert = random(VTOPLIMIT, VBOTLIMIT); //set limits
  randomdelay = random(1000, 4000); //moves every 1 to 4 seconds

  horServo.write(randomhor); //write to the horizontal servo
  vertServo.write(randomvert); //write to the vertical servo
  delay(randomdelay); //delay a random amount of time (within values set above)
}

steinklatre: I am using a PCduino

The PCduino has nothing to do with Arduino, so I doubt this is the proper forum to ask for help.

Not too sure, but trying to compile it on the arduino software compiles without any errors? I haven’t used the PCduino before through, but it could be the way PCduino adds things? Where are you putting the servo.h file that you obtained?
and might be worth testing out changing
#include <Servo.h>
to
#include “Servo.h”

[quote author=James C4S link=topic=192714.msg1424188#msg1424188 date=1381459200]

steinklatre: I am using a PCduino

The PCduino has nothing to do with Arduino, so I doubt this is the proper forum to ask for help. [/quote]

James, true but the library error is as unique to the Arduino. Why do you say the PCduino has nothing to do with the Arduino?

Lance

steinklatre:
James, true but the library error is as unique to the Arduino.

In what way? It works fine for me. How are you “using” the Arduino on this PCduino thing?

steinklatre:
Why do you say the PCduino has nothing to do with the Arduino?

Well, because, it doesn’t. It would be like posting a question about Windows 7 on forum that sells storm windows. Just because someone uses a similar name, it doesn’t mean they are related.

PCduino has nothing to do with the Arduino project.

trustnoone:
Not too sure, but trying to compile it on the arduino software compiles without any errors? I haven’t used the PCduino before through, but it could be the way PCduino adds things? Where are you putting the servo.h file that you obtained?
and might be worth testing out changing
#include <Servo.h>
to
#include “Servo.h”

Trustnoone,

I have compiled it on the Arduino with no problem for a while now and I was curious to see how “easy” this PCduino is to use with the Arduino IDE and the Arduino labeld pins onboard. So far there is very little information and support out there since its so new.

The servo.h file doesn’t seem to be a thing actually, upon investigating further I have found SoftwareServo.h (http://playground.arduino.cc/ComponentLib/servo) which I have tried to include but didn’t work.

I will get a copy of the errors and try your suggestion of #include “Servo.h” this afternoon, I will post the results.

James on how I am using it is still very confusing to me. It appears it has GPIO pins like a raspberry pi but it ALSO labels them according the the Arduino pins for use with Arduino programming. I was under the impression I could upload a program in the Arduino IDE on the pcduino and compile and upload and it would work. Nay, I was wrong apparently. The Arduino IDE doesn’t see the Servo.h library.

To the second part while the hardware is different the Arduino IDE and the code structure is the same as far as i understand it. Not wanting to get into a pissing match I had no other way of getting help with the programming questions. :fearful:

As I said, you're asking for help on the wrong forum. I'm not suggesting you couldn't get help here, it just seems unlikely. Few people here know anything about the hardware or what they've done to plug into the IDE.

I would look for a forum for the pcDuino. I'm sure they are trying to build a community for whatever it is.

http://www.pcduino.com/wiki/index.php?title=Main_Page pcDuino is a mini PC platform that runs a PC-like OS such as Lubuntu and Android 4.0 ICS But you have installed an Arduino IDE under this Lubuntu?

SITE: http://www.pcduino.com/ FORUM: http://www.pcduino.com/forum/ I think you can more easily find an answer in a forum specific to the product.

steinklatre: I have compiled it on the Arduino with no problem for a while now and I was curious to see how "easy" this PCduino is to use with the Arduino IDE and the Arduino labeld pins onboard.

The PCduino runtime framework seems to provide an API which is very similar to Arduino's API, and I'm sure that is deliberate. As a result, it's conceivable that you could write Arduino-compatible source code and get it to compile in both environments. However, it's a different development environment with a different hardware platform and its own runtime - the similarities between them are superficial. If you run into problems with PCduino then Arduino experience is not going to take you very far, and that's all you can expect to find on the Arduino forum.