Help with mita/xdk live needed
Antwort
01.10.18 15:29

Hello, 

i am new to this xdk/iot experience and try to dive into it using mita. 

i have a simple script:

 

package main;
import platforms.xdk110;

every button_one.pressed{
	println("hi\r\n");
	println(`t: ${sayHello()}\r\n`);
}

fn sayHello(){
	println("sayHello\r\n");
	return "hello";
}

 

And this is the output:

 

INFO | XDK DEVICE 1: hi
 INFO | XDK DEVICE 1: sayHello
 INFO | XDK DEVICE 1: t: 

So, where is the error i miss ??? 

 

kind regards sven

0 (0 Stimmen)
RE: Help with mita/xdk live needed
Antwort
04.10.18 06:56 als Antwort auf Sven Kabitzki.
Hello Sven,

thank you for providing your mita script.

On the first glance your script looks fine, but unfortunately some Mita functions, like returning a non primitive variable like a char array are not supported with the XDK yet.

If you would pass for example an int32 with a number value as return value, it would be received and printed successfully, every time you press the button.

Since Mita is still in development state, there might be a support for non primitive return values in the future. But for now, I recommend to use variable types like int32 or bool, but not structs, arrays, chars or char arrays as return values.

For a great start with Mita in combination with the XDK, I recommend knowledge base , which provides great guides in the Mita section.

To access these guides, a free registration as knowledge base user is required. Follow up this step by a click on the top menu button KNOWLEDGE BASE . On the left menu, choose Mita . I recommend to start with the click on Getting Started .

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)
RE: Help with mita/xdk live needed
Antwort
04.10.18 08:36 als Antwort auf Franjo Stjepandic.

Hello Franjo, 

thanks for your response. 

i will have a look an the knowledgebase you recommended. 

Looks like i have to refresh my c knowledge ;-) 

 

kind regards

sven

0 (0 Stimmen)
RE: Help with mita/xdk live needed
Antwort
04.10.18 13:40 als Antwort auf Sven Kabitzki.
Hello Sven,

I always glad to help.

Please feel free to ask if you have further concerns or questions.

Kind regards,
Franjo
0 (0 Stimmen)