SHARE
TWEET

0 movement

NB52053 Jul 3rd, 2019 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // 0 movement
  3.  
  4. #include <mega32.h>
  5. #include<delay.h>
  6. void main(void)
  7. {
  8. // Declare your local variables here
  9. // Port A initialization
  10. DDRA=0xFF; // Selector
  11. // Port B initialization
  12. DDRB=0xFF; // Data
  13. while (1)
  14. {
  15. // Place your code here
  16. PORTA=0b11111110; // number ‘4’ 7-segment is ON
  17. PORTB=0b01100110; // digit ‘8’
  18. delay_ms(50);
  19.  
  20.  
  21. PORTA=0b11111101; // number ‘4’ 7-segment is ON
  22. PORTB=0b01100110; // digit ‘8’
  23. delay_ms(50);
  24.  
  25. PORTA=0b11111011; // number ‘4’ 7-segment is ON
  26. PORTB=0b01100110; // digit ‘8’
  27. delay_ms(50);
  28.  
  29. PORTA=0b11110111; // number ‘4’ 7-segment is ON
  30. PORTB=0b01100110; // digit ‘8’
  31. delay_ms(50);
  32.  
  33. }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top