fork download
  1. unsigned char g = 0;
  2. unsigned char r = 0;
  3. unsigned char b = 0;
  4. void T0H()
  5. {
  6.  
  7. __asm__("nop");
  8. __asm__("nop");
  9. __asm__("nop");
  10. __asm__("nop");
  11.  
  12.  
  13. }
  14. void T1H()
  15. {
  16. __asm__("nop");
  17. __asm__("nop");
  18. __asm__("nop");
  19. __asm__("nop");
  20. __asm__("nop");
  21. __asm__("nop");
  22. __asm__("nop");
  23. __asm__("nop");
  24. __asm__("nop");
  25. }
  26. void TLD()
  27. {
  28. __asm__("nop");
  29. __asm__("nop");
  30. __asm__("nop");
  31. __asm__("nop");
  32. __asm__("nop");
  33. __asm__("nop");
  34. __asm__("nop");
  35. }
  36. void setup()
  37. {
  38. DDRD = B00010000;
  39. for(int i = 0; i<57; i++)
  40. {
  41. for (int bn = 7; bn >= 0; bn--)
  42. {
  43. if (g & 1 << bn) {
  44. PORTD = 1 << 4;
  45. T1H();
  46. PORTD = B00000000;
  47. TLD();
  48. } else {
  49. PORTD = 1 << 4;
  50. T0H();
  51. PORTD = B00000000;
  52. TLD();
  53. }
  54. }
  55. for (int bn = 7; bn >= 0; bn--)
  56. {
  57. if (r & 1 << bn) {
  58. PORTD = 1 << 4;
  59. T1H();
  60. PORTD = B00000000;
  61. TLD();
  62. } else {
  63. PORTD = 1 << 4;
  64. T0H();
  65. PORTD = B00000000;
  66. TLD();
  67. }
  68. }
  69. for (int bn = 7; bn >= 0; bn--)
  70. {
  71. if (b & 1 << bn) {
  72. PORTD = 1 << 4;
  73. T1H();
  74. PORTD = B00000000;
  75. TLD();
  76. } else {
  77. PORTD = 1 << 4;
  78. T0H();
  79. PORTD = B00000000;
  80. TLD();
  81. }
  82. }
  83. }
  84. delayMicroseconds(7);
  85. }
  86.  
  87. void loop() {
  88. // put your main code here, to run repeatedly:
  89. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘setup’:
prog.c:38:1: error: ‘DDRD’ undeclared (first use in this function)
 DDRD = B00010000;
 ^~~~
prog.c:38:1: note: each undeclared identifier is reported only once for each function it appears in
prog.c:38:8: error: ‘B00010000’ undeclared (first use in this function)
 DDRD = B00010000;
        ^~~~~~~~~
prog.c:44:1: error: ‘PORTD’ undeclared (first use in this function)
 PORTD = 1 << 4;
 ^~~~~
prog.c:46:9: error: ‘B00000000’ undeclared (first use in this function)
 PORTD = B00000000;
         ^~~~~~~~~
prog.c:84:1: warning: implicit declaration of function ‘delayMicroseconds’ [-Wimplicit-function-declaration]
 delayMicroseconds(7);
 ^~~~~~~~~~~~~~~~~
stdout
Standard output is empty