Guest User

Plotter.nxc

a guest
Nov 6th, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.84 KB | None | 0 0
  1. //Plotter v2.0
  2. void up() {
  3. OnRev(OUT_B, 100);
  4. Wait(SEC_5);
  5. Off(OUT_B);
  6. }
  7.  
  8.  
  9. void down() {
  10. OnFwd(OUT_B, 100);
  11. Wait(SEC_10);
  12. Off(OUT_B);
  13. }
  14.  
  15.  
  16. void step10(int a, int b) {
  17. a*=100; b*=100;
  18. PosRegSetAngle (OUT_C, 0);
  19. PosRegAddAngle (OUT_A, 100);
  20. Wait(SEC_10);
  21. PosRegAddAngle(OUT_C, a);
  22. Wait(a*2);
  23. down();
  24. PosRegAddAngle(OUT_C, b);
  25. Wait(b*2);
  26. up();
  27. }
  28.  
  29.  
  30. void step6(int c, int d) {
  31. c*=100; d*=100;
  32. PosRegAddAngle(OUT_C, c);
  33. Wait(c*2);
  34. down();
  35. PosRegAddAngle(OUT_C, d);
  36. Wait(d*2);
  37. up();
  38. }
  39.  
  40.  
  41. task main() {
  42. PosRegEnable(OUT_AC, 40, 32, 40);
  43. step10(21,4 );
  44. step10(21,7 );
  45. step10(16,2 );
  46. step10(14,20);
  47. step10(13,22);
  48. step10(13,24);
  49. step10(12,27);
  50. step10(11,30);
  51. step10(11,31);
  52. step10(11,32);
  53. step10(10,32);
  54. step10(10,34);
  55. step10(9, 35);
  56. step10(9, 34);
  57. step10(9, 34);
  58. step10(8, 35);
  59. step10(8, 35);
  60. step10(8, 36);
  61. step10(7, 3 );
  62.                step6(0,31);
  63. step10(7, 3 );
  64.                step6(0,31);
  65. step10(7, 36);
  66. step10(7, 25);
  67.                step6(4,5);
  68. step10(6, 2 );
  69.                step6(0,8);
  70.                step6(1,10);
  71.                step6(6,3);
  72. step10(6, 10);
  73.                step6(4,9);
  74.                step6(6,3);
  75. step10(6, 9 );
  76.                step6(5,10);
  77.                step6(0,0);
  78.                step6(2,4);
  79. step10(7, 6 );
  80.                step6(5,0);
  81.                step6(0,20);
  82. step10(7, 6 );
  83.                step6(1,26);
  84. step10(7, 35);
  85. step10(7, 34);
  86. step10(8, 33);
  87. step10(10,30);
  88. step10(11,29);
  89. step10(12,27);
  90. step10(12,27);
  91. step10(13,26);
  92. step10(13,26);
  93. step10(13,25);
  94. step10(14,23);
  95. step10(15,22);
  96. step10(16,20);
  97. step10(16,20);
  98. step10(17,6 );
  99.                step6(1,4);
  100.                step6(0,3);
  101. step10(18,16);
  102. step10(18,15);
  103. step10(19,14);
  104. step10(20,11);
  105. step10(21,8 );
  106. step10(24,4 );
  107. step10(26,0 );
  108. PosRegSetAngle (OUT_C, 0);
  109. PosRegAddAngle (OUT_A, 100);
  110. Wait(SEC_10);
  111. }
Advertisement
Add Comment
Please, Sign In to add comment