How do I use cloudbit as an input for Arduino?

Is there a code for arduino to use cloudbit as an input?
I am thinking of connecting the cloudbit (date and time applet) to my arduino to trigger the output that connects to a sequencer. However, when I introduce “const int cloudInput = A0” into the Arduino, it didnt read the cloudbit at all.

I am using w20 cloud v 0.3, and w6 arduino from little bits.

Could some one please help me with this?

Thank you!

Here is my current code:

const int resetButton = A1; // this is a RESET button will set all counters to zero when pressed
const int cloudBitsPin = A0; // this sets up the CLOUDBITS Module as an INPUT
const int sequencerPin = 5; // this is the wireLess Transmitter & TEST LED OutPut (d1)

int resetButtonState = 0;
int cloudBitsValue = 0;

void setup(){
pinMode(resetButton, INPUT);
pinMode(cloudBitsPin, INPUT);
pinMode(sequencerPin, OUTPUT);
Serial.begin(9600);

}

void loop(){

cloudBitsValue = analogRead(cloudBitsPin); // Checks the "VALUE" Percentage of CloudBits Coming In via IFTTT

if(cloudBitsValue >950){
digitalWrite( sequencerPin, HIGH );
delay( 1000 );

digitalWrite( sequencerPin, LOW );
delay( 1 );

digitalWrite( sequencerPin, HIGH );
delay( 1000 );

digitalWrite( sequencerPin, LOW );
delay( 1 );

digitalWrite( sequencerPin, HIGH );
delay( 1000 );
}  else if (resetButtonState == HIGH) {
    digitalWrite(sequencerPin, LOW); //turns off Sequencer
  }
}

@acheah001 It doesnt look like you really need analog in this case so perhaps just put the cloudbit on D0 and using IFTTT have your applet be something like “If every day at 12:00 AM, then activate output of {CLOUDBIT}” then all you need to detect if its high or low in Arduino.

Let me know if that helps and if not then Ill try an experiment later tonight to help.

Hi, thank you for your reply! I will let you know tomorrow after I have tried what you recommended :slight_smile: