Ardino Onboard light control


hello everyone
Want to know about controllling the onboard led of ardino while using Own API ?
tired of it!!! help needed :frowning:


Welcome to the Cayenne Community!

Just to clarify, you would like to control the onboard led (digital pin 13 on the Uno) with Cayenne? If this is correct could you also let us know how far have you gotten, such as have you got your Arduino on the Cayenne dashboard? Please include any code you have used to this point also.

Again, welcome,




Here i am able to get my data from ardino using my own API also able to control other ardino from my dashboard but want to contol led of ardino from which i am getting data
just want to have like it
(form nucleo board tutorial)


I’m sorry @HamnaBazmi, I don’t think I can help you with this problem :disappointed:. Let’s call in the big guns and see if they can do any good.
@bestes @rsiegel @adam @kreggly do you guys have any thoughts?



@leader No Problem I will try o sort it out :slight_smile:


If you still need help please post your code and we will help you get it working.



// This example shows how to connect to Cayenne using an Ethernet W5100 shield and send/receive sample data.

#define CAYENNE_PRINT Serial
#include <CayenneMQTTEthernet.h>

#include <EmonLib.h>
EnergyMonitor emon1; 

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "2605f5a0-b19f-11e6-9ce1-1904e26cb7a0";
char password[] = "";
char clientID[] = "e5b06cd0-cf65-11e6-ae8c-f90e83be502a";

unsigned long lastMillis = 0;

void setup() {
  Cayenne.begin(username, password, clientID);
   emon1.voltage(2, 234, 1.7);  // Voltage: input pin, calibration, phase_shift
  emon1.current(1, 19.9);       // Current: input pin, calibration. 

void loop() {
emon1.calcVI(20,2000);         // Calculate all. No.of half wavelengths (crossings), time-out
    float pinVoltage ;
     pinVoltage =emon1.realPower ;
    Cayenne.virtualWrite(1, pinVoltage);
      pinVoltage = emon1.apparentPower;
       Cayenne.virtualWrite(2, pinVoltage);
      pinVoltage = emon1.Vrms;
       Cayenne.virtualWrite(3, pinVoltage);
      pinVoltage = emon1.Irms;
       Cayenne.virtualWrite(4, pinVoltage);
      pinVoltage =emon1.powerFactor;
       Cayenne.virtualWrite(5, pinVoltage);

//Default function for processing actuator commands from the Cayenne Dashboard.
//You can also use functions for specific channels, e.g CAYENNE_IN(1) for channel 1 commands.

  CAYENNE_LOG("CAYENNE_IN_DEFAULT(%u) - %s, %s",, getValue.getId(), getValue.asString());
  //Process message here. If there is an error set an error message using getValue.setError(), e.g getValue.setError("Error message");


I hope that CAYENNE_IN_DEFAULT() may help m out for this but still unable to use the function parameters


DONE WITH IT :slight_smile:
THNX @adam @Ian for your intrest in it


I take it you got things worked out, very glad to hear that. If you don’t mind I’m going to mark this as helped. Please let the community know how your project is progressing.



No problem it’s pleasure for me :slight_smile: At least you tried​:slight_smile: