Created
May 27, 2015 21:00
-
-
Save stetro/9b6d554ab4afacb63193 to your computer and use it in GitHub Desktop.
First try of wireless power plug reverse engineering with xy-mk-5v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int digiPin = 52; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(digiPin, OUTPUT); | |
} | |
void zero(){ | |
delayMicroseconds(650); | |
digitalWrite(digiPin, HIGH); | |
delayMicroseconds(1200); | |
digitalWrite(digiPin, LOW); | |
} | |
void one(){ | |
delayMicroseconds(1400); | |
digitalWrite(digiPin, HIGH); | |
delayMicroseconds(550); | |
digitalWrite(digiPin, LOW); | |
} | |
void onOne(){ | |
one(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
one(); | |
zero(); | |
zero(); | |
zero(); | |
one(); | |
} | |
void offOne(){ | |
one(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
zero(); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
onOne(); | |
delay(2000); | |
offOne(); | |
delay(2000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment