Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Can you please derive the code for options 7-12 and 0 in the above indicated program, with the following code as a starting point: #include
Can you please derive the code for options 7-12 and 0 in the above indicated program, with the following code as a starting point:
#include
int main() { int sel; char word[1024]; unsigned char reg = 0; while(1) { printf("1)\tAuthor info 2)\tcheck status 3)\tclear status 4)\tsave status 5)\tload status 6)\tset LED color 7)\tSet user value 8)\ttoggle reset 9)\tturn on 10)\tturn off 11)\tShift 12)\tSet value 0)\tExit ");
}
return(0); }
Present a menu to the user with the following options: 1)C)3)4)5)6)7)8)9)10)11)12)0)AuthorinfoCheckstatusClearstatussavestatusloadstatussetLEDcolorSetuservaluetogg7eresetturnonturnoffShiftSetvalueExit When the user selects option 7: You do not need to worry about the user entering an invalid value. 8: Toggle the 7 th bit (reset). If it is currently set to 1 , set it to 0 , if it is 0 set it to 1 . 9: set bit 0 to 1 10: set bit 0 to 0 Shift a11 bits except bit o 1 to the right (user specifies amount to shift) 12: 0 : Exits the program, if any other option is chosen present the menu again after performing the requested task. bit numbers: 76543210 RCCUUXXP l^MSB1^LSB Bits 1 and 2 are unused, but can be set via the bit shift operation. P - Power bit x - unused U - user value C= Color R= reset so a value of oxc1 (or 11000001 would have the power and reset bits set to 1 , and color would be green)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started