Introduction: Sticks, Threads and WIFI - RC Car

About: Hi! I make different things :)

During these New Year's holidays, I decided to please myself and my sons with a new toy - a radio-controlled car made from simple bamboo sticks.

It will be a car with an NodeMCU and Wi-Fi controlled.

Supplies

Step 1: Rear Chassis

Just look at the images :)

Step 2: Car Body

Just look at the images :)

Step 3: Electronic Circuit

Just look at the image :)

Step 4: Rear Drive

Just look at the images :)

Step 5: Coding

I used the RemoteXY service to generate code for Arduino. Settings in the photo.

The code here:

//////////////////////////////////////////////
//        RemoteXY include library          //
//////////////////////////////////////////////
// RemoteXY select connection mode and include library 


// RemoteXY select connection mode and include library 
#define REMOTEXY_MODE__ESP8266WIFI_LIB_POINT
#include <ESP8266WiFi.h>


#include <RemoteXY.h>


// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID "rc"
#define REMOTEXY_WIFI_PASSWORD "rc123456"
#define REMOTEXY_SERVER_PORT 6377


// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =   // 26 bytes
  { 255,2,0,0,0,19,0,16,24,0,4,176,25,28,79,9,2,26,4,48,
  1,0,7,63,2,26 };
  
// this structure defines all the variables and events of your control interface 
struct {


    // input variables
  int8_t slider_1; // =-100..100 slider position turn 
  int8_t slider_2; // =-100..100 slider position go


    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 


} RemoteXY;
#pragma pack(pop)


/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////
#include <Servo.h>
Servo myservo; 


int motorrear = D2;
int motorback = D4;


void setup() 
{
  RemoteXY_Init ();
  
  myservo.attach(16);
  RemoteXY.slider_1 = 0;
  RemoteXY.slider_2 = 0;


  pinMode(motorrear, OUTPUT);
  pinMode(motorback, OUTPUT);
  // TODO you setup code
  
}


void loop() 

  RemoteXY_Handler ();
  
  
  // TODO you loop code
  // use the RemoteXY structure for data transfer
  // do not call delay(), use instead RemoteXY_delay() 
  int ms = RemoteXY.slider_1*8+1500;
  myservo.writeMicroseconds(ms);


  int y = RemoteXY.slider_2;
  if (y>100) y=100;
  if (y<-100) y=-100;
  if (y>0) {
    analogWrite(motorrear, y*10);
    digitalWrite(motorback, LOW);   
  }
  else if (y<0) {
    digitalWrite(motorrear, LOW);
    analogWrite(motorback, (-y)*10);
  }
  else {
    digitalWrite(motorrear, LOW);
    digitalWrite(motorback, LOW);
  }


}

Step 6: Result and Test

This is all! Thank you for your attention.

Watch the video, everything is clear and simple :)