Question: #define BITO Oxol #define BIT3 OX08 #define BITS OX20 #define BITZ OX80 Write C code to complete each of the following tasks. Use the appropriate

#define BITO Oxol #define BIT3 OX08 #define BITS OX20 #define BITZ OX80 Write C code to complete each of the following tasks. Use the appropriate BITX masks that you defined above. uint8_t myVar, yourVar; // declaration of variables to be used 1. Set bit 3 in myVar, preserve all others. 2. Clear bit 5 in myvar, preserve all others. (Hint: you must invert the bit mask) 3. Toggle bit 7 in myVar, preserve all others. 4. If bit 0 in myVar is set, decrement yourVar, otherwise increment yourVar
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
