more G-Labs products

Author Topic: Hello world Samples  (Read 4757 times)

September 25, 2014, 07:01:10 PM
Read 4757 times

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
I search and can't find any hello world samples to try do some programs.

Any volunteer to deploy this samples?

September 28, 2014, 11:04:25 PM
Reply #1

MickEE

  • *
  • Information
  • Newbie
  • Posts: 17
    • MikaelStenstrand.com
I search and can't find any hello world samples to try do some programs.

Any volunteer to deploy this samples?

Start by going to
Configure -> Automation
And in the right bottom corner u can find "Add group", Press it and write "New Group" - ok.

Inside the group, press "Actions"-button in the right down corner, "Add new program", give it a name "Hello World" -ok.

Change the program type to "C# Program"
Press "edit source code"

Now you can start coding :) The easiest thing u can do is to trigger a notification:
Program.Notify("Hello", "World");

Connect the audio to your HomeGenie and let it speak:
Program.Say("Hello, World!", "en-US");

You can turn on modules (leds or lights) by running this code:
Modules.WithName("NameOfYourLight").On();

To test the code, press the "Actions"-button in the lower right corner, and "update". After it has compiled the program u can run it by pressing "Actions", "Run".


Hope this helps :)

October 03, 2014, 08:56:54 PM
Reply #2

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Hy there

Thanks for you post
After i try do update i get the following error
"Line -16, Column 0 (Code to Run):
    Metadata file `Microsoft.CSharp.dll' could not be found"

And can't go further :/

October 03, 2014, 11:09:03 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
More details might help.  What hardware are you running on (Windows, Linux, Raspberry Pi, etc).  What version?  Perhaps export the script and post it.

October 04, 2014, 12:19:00 PM
Reply #4

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
RPI lastest version

The script is simple the line hello word you post in your sample
Code: [Select]
// CSharp Automation Program Plugin
// Example for using Helper Classes:
// Modules.WithName("Light 1").On();
Program.Notify("Hello", "World");
« Last Edit: October 04, 2014, 12:27:08 PM by codedmind »

October 06, 2014, 10:22:56 PM
Reply #5

MickEE

  • *
  • Information
  • Newbie
  • Posts: 17
    • MikaelStenstrand.com
RPI lastest version

The script is simple the line hello word you post in your sample

I'm also running HomeGenie on the Raspberry pi version B. Check the attached image for the hello world example. It should work with the code u gave in your earlier post.

Can't say from this what the problem could be, maybe try to re-install HomeGenie. Download it from this page: http://www.homegenie.it/download.php

October 15, 2014, 11:37:58 PM
Reply #6

jarrettv

  • *
  • Information
  • Newbie
  • Posts: 13
"Line -16, Column 0 (Code to Run):
    Metadata file `Microsoft.CSharp.dll' could not be found"


I'm having same issue. I was able to fix and I even sent a pull request to gene. I believe he has his flag flipped in the code.

You can see related thread here: http://www.homegenie.it/forum/index.php?topic=370.0

I think the people with Pi's who aren't having an issue must be running a different version of mono.

@MickEE @codeminded @bkenobi what does your "mono --version" say?

October 16, 2014, 08:30:15 AM
Reply #7

codedmind

  • ***
  • Information
  • Full Member
  • Posts: 92
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
   TLS:           __thread
   SIGSEGV:       normal
   Notifications: epoll
   Architecture:  armel,vfp+hard
   Disabled:      none
   Misc:          softdebug
   LLVM:          supported, not enabled.
   GC:            sgen

October 16, 2014, 04:31:40 PM
Reply #8

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I don't have access at the moment, but my setup is based on an older SD card image (~r300 would be my guess).  It could certainly be an older version of mono.  I'll try to remember to check tonight.

October 16, 2014, 04:44:01 PM
Reply #9

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
Here is my "mono --version", I'm not having the problems you describe

Quote
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

October 16, 2014, 05:51:35 PM
Reply #10

MickEE

  • *
  • Information
  • Newbie
  • Posts: 17
    • MikaelStenstrand.com
Here's what version of mono I'm running

Quote
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-proj                               ect.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

October 16, 2014, 09:17:45 PM
Reply #11

jarrettv

  • *
  • Information
  • Newbie
  • Posts: 13
Here is mine:
Code: [Select]
Mono JIT compiler version 3.4.1 (master/148b100 Sun Mar 30 09:59:44 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url]
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

October 23, 2014, 03:33:34 AM
Reply #12

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Code: [Select]
pi@raspberrypi ~ $ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4+rpi1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. [url=http://www.mono-project.com]www.mono-project.com[/url]
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp+hard
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen