Question: Could you rewrite the code below using libraries (MSP430ware DriverLib - driverlib.h) for Code Composer Studio 7.3 and MSP430 F5529 Launchpad? void main() { P1SEL=0x00;
Could you rewrite the code below using libraries (MSP430ware DriverLib - driverlib.h) for Code Composer Studio 7.3 and MSP430 F5529 Launchpad?
void main() { P1SEL=0x00; //// Selcting IO Funtion for Port1. P1DIR=0xC0; /////// P1.1 as input and P1.7(RED LED) & P1.6(Green LED) as ouput while(1) { L1: while(P1.1==1) /// check for Person is sitted { start timer T1=1; //// start timer Plz refer datasheet for Timer configuration register . if(P2.1==1) // check for Belt Tied { if(timer is not equal to zero) // check for timer is over or not Monitor timer flag { green light=1; // green light turn ON while(P2.1==1); // check for belt tied green light=0; // remove green light as belt is not tied go to L1; // jump to recheck for person is sitted or not } else { Red light=1;} // not fastened within time } else { ////ideal state; ////// no operation. } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
