Help for S-Builder for Data Logger

1 view (last 30 days)
Esther
Esther on 16 Mar 2014
Commented: Kaustubha Govind on 20 Mar 2014
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 Comment
Kaustubha Govind
Kaustubha Govind on 20 Mar 2014
Do you have a #ifndef MATLAB_MEX_FILE around the code that uses the symbols RTC_DS1307, RTC, File, etc?

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!