Tests data at the analogue In. whilst the push button is being depressed (push button pulls input to ground when depressed). Writes this to a csv type file that can be opened in excel and graphed.
Revision 0:5bd82da0cad9, committed 2010-11-28
- Comitter:
- WarwickRacing
- Date:
- Sun Nov 28 17:05:40 2010 +0000
- Commit message:
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Debounced.lib Sun Nov 28 17:05:40 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/WarwickRacing/code/Debounced/#8992c13bbb9b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Nov 28 17:05:40 2010 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "DebouncedIn.h" + +LocalFileSystem local("local"); + +DebouncedIn ChangeUp(p15); //Debounced class creating digital input to invoke a gear change up +AnalogIn Position(p20); //Analogue input to read current position of actuator from POT + +int i = 0; + +int main() { + +while(1) + { + FILE *Datalogging = fopen("/local/testAnalogue.csv", "w"); + while(ChangeUp.falling()) + { + i++; + fprintf(Datalogging, "%.3f,%.3f\n",Position.read(),i); + } + fclose(Datalogging); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Nov 28 17:05:40 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e