-Do it yourself -make it at home -Electronics -Electronic projects -Arduino, Atmega, -Homemade -Breadboard project -How to do -Inside the components -learn with Practically
I have to send "Hello " message from one WIFI module to another module to check the module range & strength then what should i do? which mode (Ap or STA) do i need to set for WIFI module. could you please help me.
// Define the pins for the ultrasonic sensor const int trigPin = 9; const int echoPin = 10; // Define the pin for the servo motor that makes the dinosaur jump const int servoPin = 6; // Include the Servo library #include <Servo.h> // Create a Servo object Servo myServo; void setup() { // Initialize the ultrasonic sensor pins pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); // Attach the servo motor to its pin myServo.attach(servoPin); } void loop() { // Measure the distance to the nearest obstacle long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration / 2) / 29.1; // Convert to distance // If an obstacle is detected within 20 cm, make the dinosaur jump if (distance < 20) { // Make the dinosaur jump by moving the servo motor myServo.write(90); // Adjust this angle as needed for the jump delay(500); // Adjust the delay as needed for the jump duration myServo.write(0); // Return to the original position } delay(100); // Wait before the next loop iteration }