BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

I need a help regarding my project

Hello.
I need a help regarding my project. I would like to use gauge, button and superchart in Blynk. But I did not know what the code to write and which part should I write.

This is my coding.

int sensorPin = A0;  
int outputValue = 0;  
int outputValueReal = 0;
int motor = 7;

void setup() 
{
  Serial.begin(9600);
  pinMode(motor,OUTPUT);
  Serial.println("Reading From the Sensor ...");
  delay(2000);
}

void motorState(int state)
{
  digitalWrite(5,state);
}

void loop() 
{
 
  outputValue = analogRead(sensorPin);
  outputValueReal = map(outputValue, 1023, 0, 0, 100);
  Serial.print("Moisture: ");
  Serial.print(outputValueReal);
  Serial.println("%");

  if(outputValue >= 400)
  {
motorState(400);
    digitalWrite(motor,LOW);
  }
  else
  {
  motorState(1000);
    digitalWrite(motor,HIGH);
  }
  delay(1000);
}

Ohhh the fun I could have with this strange statement… :innocent: … Pick three random widgets and without us knowing what they are supposed to even do, you want us to help you write code for it :rofl:

Hello and Welcome to Blynk. First off, I moved your post into its own topic, as it is not considered a nice thing to tack your issue onto someone else’s topic, particularly a 2 year old one :stuck_out_tongue_winking_eye:

Secondly, please read the Welcome Topic and see how you need to do a little bit of reading before posting general “Help” questions… There is Documentation, Help Topics and Example Sketches (links all at the top of this page… scroll up) that will help you learn how to use Blynk… then as you have specific questions, we will try to help.

And finally, when posting code, please format it properly as per the aforementioned Welcome Topic (I fixed your post for you this time :slight_smile: )

Thanks.

I am sorry because I don’t read clearly and about my post. Thank you for your explaination.

in the loop
may only stand blynk.run and timer.run only times so tip of me rest please explore yourself makes more fun

Thank you.