A lot of libraries seem to want to use #include “Arduino.h”
. A simple solution that has worked for me (so far, it seems) is replacing it with:
#define ARDUINO_H
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
This may not work in all cases, but it has compiled for me thus far. The libraries I’m attempting to port don’t seem to complain after I paste in this fix.
5 Likes
Thanks! This works for me. I have the Arduino PID library up and running.
timb
February 15, 2014, 4:11am
3
Or you could remove the #include "Arduino.h"
entirely. All the std*.h libraries are included by default.
BDub
February 15, 2014, 4:18am
4
Actually there are a lot of things inside Arduino.h that programs need... and Spark hasn't implemented them all. Lot's of macros. See here:
Here they are: #define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitWrite(value, bit,...