Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2. #include "Lock.h"
  3. #include "Speaker.h"
  4.  
  5. int main(void) {
  6. int n;
  7. LOCK_GenerateLock(); /* generate a new lock of type 'unsigned int' (32bit) */
  8.  
  9. /* From here on you can test your key with the lock using the LOCK_Test() function.
  10. * LOCK_Test() returns the number of correct bits for a given test key:
  11. * Use the bit operations you have learned to find the correct key number.
  12. * For each bit found or not found, play a sound with the loud
  13. */
  14.  
  15. n = LOCK_Test(5); /* check number of correct bits */
  16. SPEAKER_Play(1000,200); /* play 1000 Hz for 200 ms */
  17. return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement