abetoo
Published © GPL3+

Arduino-Controlled Wall-E Head

In this project I'll show you how to control a servo remotely from a regular web page without needing a web server in your Arduino board.

BeginnerFull instructions provided1 hour2,123

Things used in this project

Hardware components

RobotGeek Continuous Rotation Servo
RobotGeek Continuous Rotation Servo
×1
SparkFun Breadboard Power Supply 5V/3.3V
SparkFun Breadboard Power Supply 5V/3.3V
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1

Software apps and online services

Abetoo IoT Framework

Story

Read more

Schematics

Remote controlled Wall-E head schematics

Code

Arduino Wall-E source code

Arduino
/* 
 * This file is part of the Abetoo IoT Framework
 * Copyright (c) 2017 Chocron J.
 * 
 * This program is free software: you can redistribute it and/or modify  
 * it under the terms of the GNU General Public License as published by  
 * the Free Software Foundation, version 3.
 *
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License 
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#include "abtoo.h"
#include <ESP8266WiFi.h>

// WiFi
char* ssid = "MYSSID";
char* password = "MYPASSWORD";

AbetooIno abtoino;

// Abetoo Message received callback
void messageReceived(String message)
{
  if (message.startsWith("rotateAt:"))
  {
    Serial.println(message);
    message.remove(0, 9);
    analogWrite(0, message.toInt()); // set rotation speed
    delay(15);
  }
}

void setup() {
  Serial.begin(9600);

  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

  analogWriteFreq(50);
  analogWrite(0, 80); // stopped
  
  abtoino.init("uuid1", "-52tlHTNJL0mtMJSyO5nrEw636307126199001793#f635ea005d5800bc0e41b597016db5a0bfa08b7c", 1, messageReceived);
}

void loop() {
  abtoino.abetooloop();
}

Credits

abetoo

abetoo

0 projects • 7 followers
Software and Hardware Development

Comments