Advertisement
NapsterMP3

DMX gaucho

Aug 31st, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1.  
  2.  
  3. #define pin 5
  4. void setup() {
  5. pinMode(pin,OUTPUT);
  6.  
  7. }
  8.  
  9. void loop() {
  10. pausa();
  11. mof();
  12. slot0();
  13.  
  14.  
  15. for(int i=0; i<512;i++){
  16.  
  17. digitalWrite(pin,LOW);//start bit
  18. delayMicroseconds(4);
  19. digitalWrite(pin,HIGH);
  20. delayMicroseconds(24);
  21. digitalWrite(pin,LOW);
  22. delayMicroseconds(8);
  23. digitalWrite(pin,HIGH);//Stop Bit
  24. delayMicroseconds(8);
  25. }
  26.  
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34. void pausa(){
  35. digitalWrite(pin,LOW);
  36. delayMicroseconds(100);
  37.  
  38. }
  39.  
  40. void mof(){
  41. digitalWrite(pin,HIGH);
  42. delayMicroseconds(12);
  43.  
  44. }
  45.  
  46. void slot0(){
  47. digitalWrite(pin,LOW);//start bit
  48. delayMicroseconds(36);
  49. digitalWrite(pin,HIGH);//Stop bit
  50. delayMicroseconds(8);
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement