Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please derive the code for options 4, 5, and 6, in the above indicated program, with the following code as a starting point:

image text in transcribed

Can you please derive the code for options 4, 5, and 6, in the above indicated program, with the following code as a starting point:

#include #include #include #include #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) Author info 2) Check status 4) clear status 5) 5ave status 6) set LED color 7) Set user value 8) toggle reset 9) turn on 10) turn off 11) Shift 12) Set value When the user selects option 4: specify a file name and save the current register value in binary format to that file (user types the file name) 5: specify a file name and load the register value from that file (user types the file name) 6: set bits 6 and 5 with the following values: 00 : OFF 01: Red 10: Green 11: B7ue bit numbers: 76543210 RCCUUXXP i^MSBI^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 0xc1 (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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions