Kayıtlar

bit shifting etiketine sahip yayınlar gösteriliyor

Thunderstorm Application (MSP430 Applications C ++)

Resim
CREATING THUNDERSTORM WITH USING BIT SHIFTING METHOD  The meaning of thunderstorm is lighting up leds one by  one in order. When  application is working first time BIT0 PIN 's value is 1 . P1OUT = P1OUT << 1 Using the bit shift command, we shifted the bits to the left first. We then add a shift right command to this function to get the pattern resembling cumbersome.thunderstorm. P1OUT = P1OUT >> 1; Codes that embed into MSP430: --------------------------------------------- #include <msp430.h>//chosing the library int a; void delay(long int ); // We have defined a delay function to see the led is on . void main(void) {   WDTCTL = WDTPW | WDTHOLD;   BCSCTL1= CALBC1_1MHZ; //DCOCLK 1MHZ is chosed....  DCOCTL = CALDCO_1MHZ;   P1DIR= 0x1F ; //P1.0,P1.1,P1.2,P1.3,P1.4 is chosed!!!!   P1OUT=0x01;//We made the first bit 1 for bitwise shifting. while (1){ //infinite loop for ( a=0; ...