more G-Labs products

Author Topic: Led control  (Read 1736 times)

June 05, 2014, 03:28:32 PM
Read 1736 times

slade

  • *
  • Information
  • Newbie
  • Posts: 2
Hello
I want to integrate my  controllers in HG.
I use them for aquarium or plant lightning and monitoring.
But I'm not sure i'm on the right way  ::)

The light control:
-It's an infinite loop, for the plants i can have a refresh time of 1min or more on timer, but for reef aquarium i use pca9685 and the ramping with 4096 is definitively better than the 256 of standard arduino pwm. 1h ramping = less than a second refresh, and if i want realistic weather 60hz refresh is better.
First question: the scripts can run forever? It's better to create a plug-in ? create a daemon for pi and interface it with HG?

-I want to provide the light sunrise sunset based on coordinate. I Already have the code, but I think it's better to use existing application (solar altitude), but how to put two solar altitude with different coordinates (Great Barrier Reef for example). And adjust the time ( +/- some hours).

-To control all the leds I have leds in channels, channels in groups, groups in the led manager. A channel use a pca9685 pin. How can I represent this following the HG philosophy? 

June 05, 2014, 04:32:00 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi slade,

I'm answering just some of your question since most are out of my knowledge =)

Scripts can run forver and act as a daemon. For using GPIO I'd suggest a C# plugin.

You can duplicate Solar Altitude program but it will need to be modified for using different scheduler events name (perhaps just changing the prefix), otherwise it will be overwriting scheduler entries from the original Solar Altitude program.

You can address and program PCA9586 connected to Rpi with HomeGenie. You can see some code example from the test program on the raspberrysharp-io library site (this is the library you can use inside an HG C# plugin):

https://github.com/raspberry-sharp/raspberry-sharp-io/blob/master/Tests/Test.Gpio.Pca9685/Program.cs

Hope this helps.

g.

June 05, 2014, 06:03:02 PM
Reply #2

slade

  • *
  • Information
  • Newbie
  • Posts: 2
Ok for the c# plugin.

So if i have to duplicate solar altitude, there is no system to add two modules for example if I have a house in london monitored, and one in roma, i can't have local time & weather? each one with it's own event.

June 05, 2014, 06:28:47 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Yes, you can, the only problem is for Solar Altitude on the events scheduler , so if you are not planning using the scheduler events there will be no problem.

g.