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.
main.cpp
00001 /* 00002 * G3: WATERPLAY 00003 */ 00004 00005 #include "mbed.h" 00006 #include "Flasher.h" 00007 #include "SalinitySensor.h" 00008 #include "TemperatureSensor.h" 00009 #include "Thermostat.h" 00010 #include "Procedure.h" 00011 #include "Waterplay.h" 00012 #include "TextLCD.h" 00013 #include "Printer.h" 00014 #include "Tank.h" 00015 00016 DRV8825 salinitySyringe( 00017 p21, p27, p28, p29, p22, p23 00018 ); 00019 DRV8825 waterSyringe( 00020 p24, p27, p28, p29, p25, p26 00021 ); 00022 TextLCD lcd( 00023 p19, p20, p11, p12, p13, p14 00024 ); 00025 char buffer[128]; 00026 char program_name[128] = "G3: WATERPLAY"; 00027 int keep_running = 1; 00028 Serial serial(USBTX, USBRX); 00029 Flasher led1(LED1); 00030 Flasher alarm(p17); 00031 InterruptIn statusSwitch(p8); 00032 InterruptIn actionSwitch(p9); 00033 Printer printer(serial, lcd); 00034 00035 SalinitySensor salinitySensor( 00036 printer, 00037 p16 00038 ); 00039 00040 TemperatureSensor temperatureSensor( 00041 printer, 00042 p15 00043 ); 00044 00045 Thermostat thermostat( 00046 printer, 00047 p5, 00048 LED4 00049 ); 00050 00051 Ping pinger(p30); 00052 00053 Tank tank( 00054 printer, 00055 salinitySyringe, 00056 waterSyringe, 00057 pinger, 00058 alarm 00059 ); 00060 00061 Waterplay waterplay( 00062 printer, 00063 temperatureSensor, 00064 salinitySensor, 00065 thermostat, 00066 tank, 00067 led1, 00068 alarm 00069 ); 00070 00071 DigitalIn button(p7); 00072 00073 Procedure procedure( 00074 printer, 00075 button 00076 ); 00077 00078 void switchStatus(){ 00079 printer.switchStatus(); 00080 } 00081 00082 void switchAction(){ 00083 printer.switchAction(); 00084 } 00085 00086 int main() 00087 { 00088 statusSwitch.rise(switchStatus); 00089 actionSwitch.rise(switchAction); 00090 00091 printer.display(); 00092 led1.flash(1); 00093 //procedure.proceed(); 00094 //tank.initialize(); 00095 00096 while(keep_running) { 00097 waterplay.control(); 00098 } 00099 }
Generated on Tue Jul 12 2022 19:11:49 by
1.7.2