Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed
chipNumbers.h
00001 #include "mbed.h" 00002 //Define the integers to store the number of chips in each dispensor tube. 00003 int redAmount; //The amount of chips curs 00004 int greenAmount; 00005 int blueAmount; 00006 int recycleAmount; 00007 00008 /* readChipNumbers() 00009 * Read the number of chips in each tube form the txt file on the MBED. 00010 * 00011 * The txt file provides non-volatile memory to store the keep track of 00012 * the chips een if the device loses power. 00013 */ 00014 void readChipNumbers(){ 00015 redAmount = readFile(0); 00016 greenAmount = readFile(1); 00017 blueAmount = readFile(2); 00018 recycleAmount = readFile(3); 00019 } 00020 00021 //Decrement the amount of red chips in the storage tube by one. 00022 void decrementRed(){ 00023 redAmount--; 00024 } 00025 00026 //Decrement the amount of green chips in the storage tube by one. 00027 void decrementGreen(){ 00028 greenAmount--; 00029 } 00030 00031 //Decrement the amount of blue chips in the storage tube by one. 00032 void decrementBlue(){ 00033 blueAmount--; 00034 } 00035 00036 //Increment the amount of red chips in the storage tube by one. 00037 void incrementRed(){ 00038 redAmount++; 00039 } 00040 00041 //Increment the amount of green chips in the storage tube by one. 00042 void incrementGreen(){ 00043 greenAmount++; 00044 } 00045 00046 //Increment the amount of blue chips in the storage tube by one. 00047 void incrementBlue(){ 00048 blueAmount++; 00049 }
Generated on Thu Jul 14 2022 19:06:18 by
1.7.2