Advertisement
ToBeNamed

bonniehand.cpp

Oct 7th, 2014
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.26 KB | None | 0 0
  1. #include servo.h
  2.  
  3. int Finger1 = 0;
  4. int Finger2 = 1;
  5. int Finger3 = 2;
  6. int Finger4 = 3;
  7. int Finger5 = 4;
  8.  
  9. void setup()
  10. {
  11.     Serial.begin(9600);
  12. }
  13.  
  14. void loop()
  15. {
  16.     byte servoValue1;
  17.     byte servoValue2;
  18.     byte servoValue3;
  19.     byte servoValue4;
  20.     byte servoValue5;
  21.  
  22.     int FingerV1 = analogRead(Finger1);
  23.     int FingerV2 = analogRead(Finger2);
  24.     int FingerV3 = analogRead(Finger3);
  25.     int FingerV4 = analogRead(Finger4);
  26.     int FingerV5 = analogRead(Finger5);
  27.  
  28.     if (FingerV1 < 200) FingerV1 = 200;
  29.     else if (FingerV1 > 460) FingerV1 = 460;
  30.     if (FingerV2 < 200) FingerV2 = 200;
  31.     else if (FingerV2 > 460) FingerV2 = 460;
  32.     if (FingerV3 < 200) FingerV3 = 200;
  33.     else if (FingerV3 > 460) FingerV3 = 460;
  34.     if (FingerV4 < 200) FingerV4 = 200;
  35.     else if (FingerV4 > 460) FingerV4 = 460;
  36.     if (FingerV5 < 200) FingerV5 = 200;
  37.     else if (FingerV5 > 460) FingerV5 = 460;
  38.  
  39.     byte servoVal1 = map(FingerV1,460, 200, 255, 0);
  40.     byte servoVal2 = map(FingerV2,460, 200, 255, 0);
  41.     byte servoVal3 = map(FingerV3,460, 200, 255, 0);
  42.     byte servoVal4 = map(FingerV4,460, 200, 255, 0);
  43.     byte servoVal5 = map(FingerV5,460, 200, 255, 0);
  44.  
  45.     Serial.print(servoVal1);
  46.     Serial.print(servoVal2);
  47.     Serial.print(servoVal3);
  48.     Serial.print(servoVal4);
  49.     Serial.print(servoVal5);
  50.    
  51.     delay(100);
  52. }
  53.  
  54. /*All I wanted was to be a rock star.
  55. The fame, the adoration, the music.
  56. I wanted to play music like the Beatles
  57. Like Hendrix, like Kiss, like Michael
  58. Jackson. I wanted to be like Bonnie.
  59.  
  60. I got what I deserved. Every night I
  61. suffer the events leading up to this.
  62. What's worse, I think I'm starting to
  63. like it. During the day, I'm actually
  64. playing Hendrix, Kiss, Beatles and MJ.
  65. That part's not so bad, though I can
  66. feel how stiff the joints are when we
  67. play. I guess I got what I wanted when
  68. I followed him.
  69.  
  70. It was slow, it was painful, it was clean.
  71. Not like her, she got it like Jason
  72. Vorhees. I see the other kids during the
  73. day, wanting to scream, but my mouth
  74. and new voicebox won't let me. Why did
  75. I have to die? Why did WE have to die?
  76.  
  77. It's like being stuck on a ride until
  78. you puke over and over and over and over
  79. and over until you think you're almost
  80. done, but then it starts again and never
  81. ends. I thought this was hell and I was
  82. being punished, but I've made other kids
  83. smile. We've made other kids smile. Bonnie's
  84. made other kids smile. Maybe if we do
  85. good and atone?*/
  86.  
  87. #include
  88.  
  89. Servo myservo1; // create servo object to control a servo
  90. Servo myservo2;
  91. Servo myservo3;
  92. Servo myservo4;
  93. Servo myservo5;
  94.  
  95. void setup()
  96. {
  97.     Serial.begin(9600);
  98.  
  99.     myservo1.attach(2); // attaches the servo on pin 9 to the servo object
  100.     myservo2.attach(3);
  101.     myservo3.attach(4);
  102.     myservo4.attach(5);
  103.     myservo5.attach(6);
  104. }
  105.  
  106. void loop()
  107. {
  108.     if(Serial.available() >=5)
  109.     {  
  110.         byte servoAng1 = Serial.read();
  111.         byte servoAng2 = Serial.read();
  112.         byte servoAng3 = Serial.read();
  113.         byte servoAng4 = Serial.read();
  114.         byte servoAng5 = Serial.read();
  115.         // Send the servo to the position read...  (note: you get to make this happen)
  116.  
  117.         myservo1.write(servoAng1);
  118.         myservo2.write(servoAng2);
  119.         myservo3.write(servoAng3);
  120.         myservo4.write(servoAng4);
  121.         myservo5.write(servoAng5);
  122.     }
  123. }
  124.  
  125. /*Security is the only human contact we
  126. can get while in control of the bodies we
  127. possess. It's a brief amount of time and
  128. the guards seem scared when we approach.
  129. We've been poking and prodding and playing
  130. Red light green light with some of them
  131. to pass the time. Sometimes we stop at
  132. the window, sometimes we do other things.
  133. We did a terrible thing to one we managed
  134. to catch. These are the lines of code that
  135. went into effect, the cold hands of Bonnie
  136. squeezed his throat until he died. Our
  137. cold hands squeezed until he died.
  138.  
  139. I squeezed until he died, I felt sick and
  140. glad seeing the tears run down his face
  141. just before he went limp. I screamed.
  142. I couldn't stop screaming for a while.
  143. The others joined in. I'd never hurt
  144. anyone this bad before. Am I bad for
  145. hurting someone like this? I don't
  146. feel sorry at all.
  147.  
  148. All of us worked together to catch him,
  149. he was going to bring back someone one
  150. of us knew. One of us trusted. Maybe we
  151. can move on to the afterlife when all
  152. of the suits are filled? That's the
  153. idea the kid in Freddy has. I want to
  154. go home, I want to die, I want to just
  155. get out of here.*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement