fork download
  1. char volatile one [ ] ="00000000.00000000.00000000";
  2. char two [ ] ="11111111.00000000.00000000";
  3. void delay400()
  4. {
  5. for(int i = 0; i<6; i++)
  6. {
  7. __asm__("nop");
  8. }
  9. }
  10. void delay850()
  11. {
  12. for(int i = 0; i<13; i++)
  13. {
  14. __asm__("nop");
  15. }
  16. }
  17. void delay800()
  18. {
  19. for(int i = 0; i<12; i++)
  20. {
  21. __asm__("nop");
  22. }
  23. }
  24. void delay450()
  25. {
  26. for(int i = 0; i<7; i++)
  27. {
  28. __asm__("nop");
  29. }
  30. }
  31.  
  32. void setup()
  33. {
  34.  
  35. for(int i = 0;i < 2;i++)
  36. {
  37. for(int i = 0; i < 27; i++)
  38. {
  39. if(one[i] == '1')
  40. {
  41. PORTD = B0001000;
  42. delay800();
  43. PORTD = B00000000;
  44. delay450();
  45. }
  46. if(one[i] == '0')
  47. {
  48. PORTD = B00010000;
  49. delay400();
  50. PORTD = B00000000;
  51. delay850();
  52. }
  53. }
  54. delayMicroseconds(50);
  55. }
  56. }
  57. void loop() {
  58. // put your main code here, to run repeatedly:
  59. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void setup()’:
prog.cpp:41:1: error: ‘PORTD’ was not declared in this scope
 PORTD = B0001000;
 ^~~~~
prog.cpp:41:9: error: ‘B0001000’ was not declared in this scope
 PORTD = B0001000;
         ^~~~~~~~
prog.cpp:43:9: error: ‘B00000000’ was not declared in this scope
 PORTD = B00000000;
         ^~~~~~~~~
prog.cpp:48:1: error: ‘PORTD’ was not declared in this scope
 PORTD = B00010000;
 ^~~~~
prog.cpp:48:9: error: ‘B00010000’ was not declared in this scope
 PORTD = B00010000;
         ^~~~~~~~~
prog.cpp:50:9: error: ‘B00000000’ was not declared in this scope
 PORTD = B00000000;
         ^~~~~~~~~
prog.cpp:54:21: error: ‘delayMicroseconds’ was not declared in this scope
 delayMicroseconds(50);
                     ^
stdout
Standard output is empty