Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define pin 5
- void setup() {
- pinMode(pin,OUTPUT);
- }
- void loop() {
- pausa();
- mof();
- slot0();
- for(int i=0; i<512;i++){
- digitalWrite(pin,LOW);//start bit
- delayMicroseconds(4);
- digitalWrite(pin,HIGH);
- delayMicroseconds(24);
- digitalWrite(pin,LOW);
- delayMicroseconds(8);
- digitalWrite(pin,HIGH);//Stop Bit
- delayMicroseconds(8);
- }
- }
- void pausa(){
- digitalWrite(pin,LOW);
- delayMicroseconds(100);
- }
- void mof(){
- digitalWrite(pin,HIGH);
- delayMicroseconds(12);
- }
- void slot0(){
- digitalWrite(pin,LOW);//start bit
- delayMicroseconds(36);
- digitalWrite(pin,HIGH);//Stop bit
- delayMicroseconds(8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement