The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a program to control a sump pump. A sump well collects water runoff. The sump pump pumps out the well whenever it fills up. When the level rises to a high limit, the pump turns on. It stays on until the level drops to a low limit. Then the pump shuts off. It does not turn on again until the well fills up to the high limit. Data is stored in the following three addresses:
| Address | Data |
| $2100 | High Limit |
| $2101 | Low Limit |
| DIP_SW | Level Reading (SW_PORT) |
| Port B | Pump Control (LED_PORT) |
The level has a range of $00 to $FF, representing empty to full. You can set the low and high limits to values within the range (e.g.,$10 and $F0, you can use "mm" command to set these values or use assembly program to initialize the values). Sending a value of $FF to LEDs turns on the pump. Sending a value of $00 turns it off. You can test your program operation by changing the DIP switch and see the LEDs turn on and off based on the switch value (water level).
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll