Simulink based app is not logging data to thingspeak
Pramod Tripathi
on 5 Jul 2022
Latest activity Reply by Pramod Tripathi
on 6 Jul 2022
Simple app created using Simulink support package for Android device. App created but data is not getting logged on thingspeak channel the error msg on app log is as attached.

1 Comment
Time Descending#include "gyrotry.h"
17 #include "gyrotry_private.h"
18
19 /* Real-time model */
20 RT_MODEL_gyrotry_T gyrotry_M_;
21 RT_MODEL_gyrotry_T *const gyrotry_M = &gyrotry_M_;
22
23 /* Model step function */
24 void gyrotry_step(void)
25 {
26 real32_T out[3];
27 uint32_T sendPost;
28
29 /* MATLABSystem: '<S1>/MATLAB System' */
30 out[0] = 0.0F;
31 out[1] = 0.0F;
32 out[2] = 0.0F;
33 GET_GYROSCOPE_DATA(&out[0], &out[1], &out[2]);
34
35 /* MATLABSystem: '<Root>/ThingSpeak Write' incorporates:
36 * MATLABSystem: '<S1>/MATLAB System'
37 */
38 CHECK_UPDATE_INTERVAL(1.0, &sendPost);
39 if (sendPost == 1U) {
40 ADD_FIELD(1.0, 1, (real_T)out[0]);
41 ADD_FIELD(1.0, 2, (real_T)out[1]);
42 ADD_FIELD(1.0, 3, (real_T)out[2]);
43 SEND_POST_REQUEST(1.0);
44 }
45
46 /* End of MATLABSystem: '<Root>/ThingSpeak Write' */
47 }
48
49 /* Model initialize function */
50 void gyrotry_initialize(void)
51 {
52 {
53 char_T tmp[17];
54 int32_T i;
55 static const char_T tmp_0[17] = "1TB72YHJP7KMKWFF";
56
57 /* Start for MATLABSystem: '<S1>/MATLAB System' */
58 INITIALIZE_GYROSCOPE();
59
60 /* Start for MATLABSystem: '<Root>/ThingSpeak Write' */
61 for (i = 0; i < 17; i++) {
62 tmp[i] = tmp_0[i];
63 }
64
65 INIT_THINGSPEAK_WRITE(1.0, 1.789946E+6, tmp, 15.0);
66
67 /* End of Start for MATLABSystem: '<Root>/ThingSpeak Write' */
68 }
69 }
70
71 /* Model terminate function */
72 void gyrotry_terminate(void)
73 {
74 /* (no terminate code required) */
75 }
76
77 /*
78 * File trailer for generated code.
79 *
80 * [EOF]
81 */
This is the code generated
Sign in to participate