By adding Wire.h file the IDE automatically adds a line like this to the source code: // This #include statement was automatically added by the Spark IDE.Īs long as the Arduino source follows basic guidelines for portable code I did not face much difficulties to use existing Arduino sources on the Spark Core. With this library all we have to do is to uncomment or delete the original include statement. To solve this problem I created a new library named Wire.h with the following content: #include "spark_wiring.h" So it includes the Arduino Wire Library with the following line: #include The main reason this code fails to compile is the Arduino Wire.h library include statement fails on the cloud based Spark Core IDE. it's a 12bit int, using two's compliment for negative Simple code for the TMP102, simply prints ambient temperature via serial Released under the MIT License - Please reuse change and share So here are some hints how to get Arduino library code and sketches to compile in the Spark framework. I use a TMP102 I2C temperature sensor to demonstrate the porting. So now that the Spark IDE supports multiple project files we can just include Arduino library files. However the approach I took there to combine all code into a single file is not very practical. In an earlier post Spark Core Weather Station I presented code that was reading weather sensors and sent the data over USB to a PC terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
June 2023
Categories |