Sometime when I need some wire so I took a full thread spool but I am done with my work it is difficult to rewind all that again. So today I though to make a winding machine. First I build a thread winding Machine. Then I programmed it to be controlled via Bluetooth. So I just used an old app for controlling because I didn’t have time to program.
//This program is used to control a Dc Motor using a app that communicates with Arduino through a bluetooth module. //Error Code Chart: Code 01; Turnradius is higher than Speed; Code 02; Speed is higher than 255; #define in1 8 //L298n Motor Driver pins. #define in2 9 int command; //Int to store app command state. int Speed = 204; // 0 - 255. int Speedsec; int Turnradius = 0; //Set the radius of a turn, 0 - 255 Note:the robot will malfunction if this is higher than int Speed. void setup() { pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); Serial.begin(9600); //Set the baud rate to your Bluetooth module. } void loop() { if (Serial.available() > 0) { command = Serial.read(); Stop(); //Initialize with motors stoped. switch (command) { case 'F': forward(); break; case 'B': back(); break; case '0': Speed = 100; break; case '1': Speed = 140; break; case '2': Speed = 153; break; case '3': Speed = 165; break; case '4': Speed = 178; break; case '5': Speed = 191; break; case '6': Speed = 204; break; case '7': Speed = 216; break; case '8': Speed = 229; break; case '9': Speed = 242; break; case 'q': Speed = 255; break; } Speedsec = Turnradius; } } void forward() { analogWrite(in1, Speed); } void back() { analogWrite(in2, Speed); } void Stop() { analogWrite(in1, 0); analogWrite(in2, 0); }
Andriod App: For App Click Here Google Play Link.
For Any Problem Comment Below..