diff --git a/Arduino/Automatic Garage Door Code b/Arduino/Automatic Garage Door Code new file mode 100644 index 0000000..96b3f20 --- /dev/null +++ b/Arduino/Automatic Garage Door Code @@ -0,0 +1,53 @@ + +/* + Stepper Motor Control -Automatic Garage_Door + + This program drives a unipolar or bipolar stepper motor. + It will close the door for '1' input and open the door for '0' input. + */ + +#include +#include + + +SoftwareSerial BT(0,1); +// creates a "virtual" serial port/UART +// connect BT module TX to D0 +// connect BT module RX to D1 +// connect BT Vcc to 5V, GND to GND +const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution + // for your motor + +// initialize the stepper library on pins: +Stepper myStepper(stepsPerRevolution, 5,6,9,10); + +void setup() { + BT.begin(9600); // set the data rate for the SoftwareSerial port + myStepper.setSpeed(60); // set the speed at 60 rpm + Serial.begin(9600); // initialize the serial port +} +char a; // stores incoming character from other device + +void loop() { + if(BT.available()) + { + // if text arrived in from BT serial... + a=(BT.read()); + if(a=='1'){ + Serial.write(a); + //clockwise direction + for(int i=0;i<=8;i++)//{ + myStepper.step(stepsPerRevolution); + //delay(20);} + BT.write('1'); + } + else if(a=='0'){ + Serial.write(a); + // anti-clockwise direction + for(int i=0;i<=8;i++)//{ + myStepper.step(-stepsPerRevolution); + //delay(20);} + BT.write('0'); + } + } +} diff --git a/Arduino/Self_Stabalising_Platform (Labelled).fzz b/Arduino/Self_Stabalising_Platform (Labelled).fzz new file mode 100644 index 0000000..d759647 Binary files /dev/null and b/Arduino/Self_Stabalising_Platform (Labelled).fzz differ diff --git a/Arduino/garage_door_updated (Labelled).fzz b/Arduino/garage_door_updated (Labelled).fzz new file mode 100644 index 0000000..aa853c7 Binary files /dev/null and b/Arduino/garage_door_updated (Labelled).fzz differ diff --git a/Self Stabilization Platform b/Self Stabilization Platform new file mode 100644 index 0000000..15fd03a --- /dev/null +++ b/Self Stabilization Platform @@ -0,0 +1 @@ +This is the complete