フィルターのクリア

What is wrong with this code?

9 ビュー (過去 30 日間)
sicajios dsgvbdgs
sicajios dsgvbdgs 2021 年 11 月 5 日
コメント済み: Vinod 2021 年 11 月 12 日
I want to send acceleration data from a mobile phone sensor to ThingSpeak. Error: URL is incorrectly formed, or the requested feature is not supported in this version of ThingSpeak.
[acc, tacc] = accellog(m);
xAcc = acc(:,1);
yAcc = acc(:,2);
zAcc = acc(:,3);
InitialTime = datetime(m.InitialTimestamp,'InputFormat','dd-MMM-yyyy HH:mm:ss.SSS');
AccelTime = InitialTime + seconds(tacc);
channelID = XXXXX;
writeKey = XXXXXXXXXX;
tStamps = AccelTime;
data=[xAcc,yAcc,zAcc];
thingSpeakWrite(channelID,data,'TimeStamp',tStamps,'WriteKey',writeKey)
  2 件のコメント
Vinod
Vinod 2021 年 11 月 5 日
What version of MATLAB are you using?
sicajios dsgvbdgs
sicajios dsgvbdgs 2021 年 11 月 5 日
R2021b

サインインしてコメントする。

回答 (1 件)

Vinod
Vinod 2021 年 11 月 6 日
Thingspeak can only accept data sampled at 1hz or lower frequency. That is, tStamps should be at least 1s apart. My initial guess is that your accelerometer data is sampled at a much higher rate.
  8 件のコメント
sicajios dsgvbdgs
sicajios dsgvbdgs 2021 年 11 月 12 日
I want to update the accelerometer data on ThingSpeak every 1 second.
Vinod
Vinod 2021 年 11 月 12 日
That is possible.
If you have an unstable or slow internet connection, it might be that the data you send from your device does not reach the servers exactly 1s apart. You might want to add a 5-10% buffer to factor in network latencies.

サインインしてコメントする。

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeWrite Data to Channel についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by