Help for S-Builder for Data Logger
显示 更早的评论
I'm trying to implement the S-builder for my Adafruit Data Logging Shield. The data logging shield reads values from the input pins and stores them in an SD card (writes to a FILE).
The original code used in the Arduino IDE works fine.
But when I try to implement it in the S-builder, I'm encountering undeclared identifier errors such as these:
AdafruitData_wrapper.c
AdafruitData_wrapper.c(88) : error C2065: 'RTC_DS1307' : undeclared identifier
AdafruitData_wrapper.c(88) : error C2146: syntax error : missing ';' before identifier 'RTC'
AdafruitData_wrapper.c(88) : error C2065: 'RTC' : undeclared identifier
AdafruitData_wrapper.c(90) : error C2065: 'File' : undeclared identifier
AdafruitData_wrapper.c(90) : error C2146: syntax error : missing ';' before identifier 'logfile'
.........
(and a whole lot of other errors)
I've been told this is something to do with the S-builder unable to work with C++. I have gone through Driver Guide (attached pdf) by Giampiero Campa. It mentions renaming the wrapper.c file to wrapper.cpp, and adding two void functions. I've also installed this bug fix for R2013b.
But if the build process generates the error before creating the file, how are you to edit the wrapper.c file in that case?
So, it is possible to implement C++ in S-builder? 1) Calling objects 2) Creating a FILE and writing to it
My libraries:
#include <math.h>
#ifndef MATLAB_MEX_FILE
#include "Arduino.h"
#include "SD.h"
#include "Wire.h"
#include "RTClib.h"
#endif
1 个评论
Kaustubha Govind
2014-3-20
Do you have a #ifndef MATLAB_MEX_FILE around the code that uses the symbols RTC_DS1307, RTC, File, etc?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!