Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Developed by j0lama
- //Visit jolama.es
- #include <SoftwareSerial.h>
- #define tiempo 400
- #define pin 9
- void setup() {
- Serial.begin(9600);
- while (!Serial);
- pinMode(pin, OUTPUT);
- Serial.println("Dentro de 2 segundos va a mandar el codigo.");
- }
- void loop() {
- int code[170] = {1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,0,0,0,1,1,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,1,1,0,1,1,0,1,1};
- int i, j;
- Serial.println("Empezando las 3 tandas.");
- for(i = 0; i < 3; i++)
- {
- for(j = 0; j < 197; j++)
- {
- if(code[j] == 1)
- {
- digitalWrite(pin, HIGH);
- delayMicroseconds(tiempo);
- digitalWrite(pin, LOW);
- }
- else
- {
- delayMicroseconds(tiempo);
- }
- }
- Serial.println("Tanda enviada.");
- delay(15);
- }
- Serial.println("Final");
- delay(1000);
- }
Add Comment
Please, Sign In to add comment