#include // *** // *** Define the RX and TX pins. Choose any two // *** pins that are unused. Try to avoid D0 (pin 5) // *** and D2 (pin 7) if you plan to use I2C. // *** #define RX 1 // *** D3, Pin 2 #define TX 0 // *** D4, Pin 3 // These constants won't change. They're used to give names // *** // *** Define the software based serial port. Using the // *** name Serial so that code can be used on other // *** platforms that support hardware based serial. On // *** chips that support the hardware serial, just // *** comment this line. // *** SoftwareSerial Serial(RX, TX); void setup() { // initialize serial communications at 9600 bps: pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(0, OUTPUT); } void loop() { for (int i = 0; i < 30; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(2000); // digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18000); } delay(3000); for (int i = 0; i < 90; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(1500); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18500); } delay(3000); for (int i = 0; i < 30; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(2000); // digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18000); } delay(3000); for (int i = 0; i < 90; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(1500); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18500); } delay(3000); for (int i = 0; i < 30; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(2000); // digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18000); } delay(3000); for (int i = 0; i < 90; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(1500); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18500); } delay(3000); for (int i = 0; i < 30; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(2000); // digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18000); } delay(3000); for (int i = 0; i < 90; ++i) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(0, HIGH); delayMicroseconds(1500); digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(0, LOW); delayMicroseconds(18500); } delay(900000); }