IOT Cloud not showing output

Hi there, I'm having some issue that my IOT Cloud not showing any output

#include "thingProperties.h"

const int forcePin = 14;
const int piezoPin = 27;
const int buzzerPin = 13;
const int threshold = 100;

int piezo;
int forceValue;

void setup() {
  // Initialize serial and wait for port to open:
  Serial.begin(9600);
  delay(1500); // Wait for the Serial Monitor to open

  // Defined in thingProperties.h
  initProperties();

  // Connect to Arduino IoT Cloud
  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  setDebugMessageLevel(4);
  ArduinoCloud.printDebugInfo();

  pinMode(forcePin, INPUT);
  pinMode(piezoPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  ArduinoCloud.update();
  // Your code here 
  force = 0;
  piezo = 0;
  
  piezo = analogRead(piezoPin);
  forceValue = analogRead(forcePin);
  force = map(forceValue, 4095, 0, 0, 1000);

  if (piezo > threshold) {
    counter++;
    Serial.print("Counter: ");
    Serial.println(counter);
    if (force > 0) {
      counter_Bullseye++;
      digitalWrite(buzzerPin, HIGH);
      delay(100);
      digitalWrite(buzzerPin, LOW);
      Serial.print("Counter Bullseye: ");
      Serial.println(counter_Bullseye);
      Serial.print("Force: ");
      Serial.println(force);
    }
  }
  
  // Update cloud variables
  // Ensure these assignments are correct and needed
  counter = counter;
  counter_Bullseye = counter_Bullseye;
  force = force;
}

Your topic has been moved; do not post in "Uncategorized". Please see the sticky topics in Uncategorized - Arduino Forum.

Please edit your post, select all code and click the <CODE/> button. Next save your post. This will apply code tags to the code which make the code easier to read and copy and the forum software will display it correctly.


I have no knowledge of IoT cloud so can't help further.

Hi @dello_234.

I'm not sure I understood correctly what you mean by this. Please provide a more detailed description of what you mean by this in a reply on this forum thread, including:

  • What did you do?
  • What were the results you expected from doing that thing?
  • What were the results you observed that did not match your expectations?

Make sure to include the full and exact text of any error or warning messages you might have encountered.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.