【发布时间】:2015-02-06 13:30:05
【问题描述】:
我想在 arduino mega 上为 20 个传感器制作一个 typedef struct(或类似的,如果我不能),但我有一个错误,我不明白为什么。是来自 arduino 编译还是来自我的代码?您认为我必须将代码放在头文件中吗?
typedef struct {
char nom[8];
int pin;
int onOff;
int pente;
int offset;
int maximun;
int minimum;
int constante1;
int constante2;
int hyst1;
int hyst2;
float moyenne;
float valeurs[];
int frequence;
} structSondes;
structSondes sondes[20];
structSondes test;
sondes[0].pin=1;
test.pin=1;
我在编译时遇到这个错误:
错误:“探空仪”没有命名类型
错误:“测试”没有命名类型
【问题讨论】:
-
错误,它显示
sonde或sondes?此外,float valeurs[];必须在结尾(根据C99)。 -
@SouravGhosh 抱歉,这是“探空仪”
标签: c++ c struct arduino typedef