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.
Dependents: SCP1000Example 0sample_SCP1000_USB SCP1000_Fastsensing
Diff: main.cpp
- Revision:
- 2:4c2784b363ad
- Parent:
- 1:0bc094c5d1b9
--- a/main.cpp Wed Feb 02 09:09:52 2011 +0000
+++ b/main.cpp Fri Feb 04 11:56:49 2011 +0000
@@ -30,16 +30,11 @@
int main() {
char buf[32];
-
- if (sw) {
- for (int i = 0; i < 4; i++) {
- leds[i] = 1;
- }
- wait(3.0);
- for (int i = 0; i < 4; i++) {
- leds[i] = 0;
- }
- exit(0);
+
+ for (int i = 0; !sw; i = (i + 1) % 8) {
+ leds[i < 4 ? i : 7 - i] = 1;
+ wait(0.05);
+ leds[i < 4 ? i : 7 - i] = 0;
}
FILE *fp = fopen("/local/scp1000.txt", "a");
@@ -55,12 +50,12 @@
scp1000.reset();
fclose(fp);
- scp1000.setOperationMode(HIGH_SPEED_MODE);
+ scp1000.setOperationMode(SCP1000::HIGH_SPEED_MODE);
printMeasurements("SCP1000 High Speed Mode - 9Hz", 3600 * 9);
- scp1000.setOperationMode(HIGH_RESOLUTION_MODE);
+ scp1000.setOperationMode(SCP1000::HIGH_RESOLUTION_MODE);
printMeasurements("SCP1000 High Resolution Mode - 1.8Hz", 3600 * 9 / 5);
- scp1000.setOperationMode(ULTRA_LOW_POWER_MODE);
+ scp1000.setOperationMode(SCP1000::ULTRA_LOW_POWER_MODE);
printMeasurements("SCP1000 Ultra Low Power Mode - 1Hz", 3600 * 10);
}
\ No newline at end of file