Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
Y

yourry

@yourry
About
Posts
4
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Array in send message command
    Y yourry

    Great, thanks for your reply and help.
    I was able to do what I wanted, I give you some code snippets to make several messages via a for loop,
    I'm not a code proffesional but this works:

    // Initialize messages
    MyMessage msgInA(0,V_CURRENT);
    MyMessage msgWhA(0,V_WATT);
    
    
    #define NSENSORS              6				//used current sensors
    
    void setup()
    {  
    	//initialize energy monitor CurrentSensor
    	for (int i=0; i<NSENSORS; i++)
    	{   
    		wh[i]        = { 0.0 };  //initialize wh
    		lwhtime[i]   = {0};	//initialize time
    		present(i, S_MULTIMETER);  
    	}  
    	for (int i=0; i<NSENSORS; i++)
    	{  
    		present(i, S_POWER);
    	}
    }
    
    
    	
    void loop()
    {
      	for (int i=0; i<NSENSORS; i++)
    	{
    		send(msgInA.setSensor(i).set(Irms[i], 1));
    		send(msgWhA.setSensor(i).set(wh[i], 1));    
    	}
    }
    

    Thanks

    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular