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: MAX5715BOB_Tester MAX11131BOB_Tester MAX5171BOB_Tester MAX11410BOB_Tester ... more
Diff: MaximTinyTester.cpp
- Revision:
- 1:f98ddb04f9e0
- Parent:
- 0:93d4119d3f14
- Child:
- 2:9b20cadbfa15
--- a/MaximTinyTester.cpp Mon Jun 10 07:47:42 2019 +0000
+++ b/MaximTinyTester.cpp Fri Jun 21 10:52:47 2019 +0000
@@ -42,7 +42,10 @@
AnalogIn& analogInPin2,
AnalogIn& analogInPin3,
AnalogIn& analogInPin4,
- AnalogIn& analogInPin5)
+ AnalogIn& analogInPin5,
+ DigitalOut& m_RFailLED,
+ DigitalOut& m_GPassLED,
+ DigitalOut& m_BBusyLED)
: associatedCmdLine(AssociatedCmdLine)
, analogInPin0(analogInPin0)
, analogInPin1(analogInPin1)
@@ -50,12 +53,16 @@
, analogInPin3(analogInPin3)
, analogInPin4(analogInPin4)
, analogInPin5(analogInPin5)
+ , m_RFailLED(m_RFailLED)
+ , m_GPassLED(m_GPassLED)
+ , m_BBusyLED(m_BBusyLED)
{
nPass = 0;
nFail = 0;
err_threshold = 0.030; // 30mV
input_timeout_time_msec = 250;
settle_time_msec = 250;
+ blink_time_msec = 75;
analogInPin_fullScaleVoltage[0] = 3.300;
analogInPin_fullScaleVoltage[1] = 3.300;
analogInPin_fullScaleVoltage[2] = 3.300;
@@ -73,6 +80,7 @@
{
nPass = 0;
nFail = 0;
+ m_RFailLED = LED_ON; m_GPassLED = LED_ON; m_BBusyLED = LED_OFF;
}
/** report that a test has completed with success.
@@ -83,6 +91,12 @@
void MaximTinyTester::PASS()
{
++nPass;
+ // m_RFailLED = LED_ON; m_GPassLED = LED_ON; m_BBusyLED = LED_ON;
+ // pulse blue LED during test to indicate activity
+ m_GPassLED = LED_OFF; m_BBusyLED = LED_ON;
+ wait_ms(blink_time_msec); // delay
+ m_GPassLED = LED_ON; m_BBusyLED = LED_OFF;
+ wait_ms(blink_time_msec); // delay
associatedCmdLine.serial().printf("\r\n+PASS ");
}
@@ -94,6 +108,12 @@
void MaximTinyTester::FAIL()
{
++nFail;
+ // m_RFailLED = LED_ON; m_GPassLED = LED_ON; m_BBusyLED = LED_ON;
+ // pulse blue LED during test to indicate activity
+ m_RFailLED = LED_OFF; m_BBusyLED = LED_ON;
+ wait_ms(blink_time_msec); // delay
+ m_RFailLED = LED_ON; m_BBusyLED = LED_OFF;
+ wait_ms(blink_time_msec); // delay
associatedCmdLine.serial().printf("\r\n-FAIL ");
#if USE_LEDS
rgb_led.red(); // diagnostic rbg led RED
@@ -117,16 +137,12 @@
//~ associatedCmdLine.serial().printf(g_SelfTest_nFail);
//~ associatedCmdLine.serial().printf(" FAIL\r\n");
if (nFail == 0) {
-#if USE_LEDS
+ m_RFailLED = LED_OFF; m_GPassLED = LED_ON; m_BBusyLED = LED_OFF;
+ //~ rgb_led.green(); // diagnostic rbg led GREEN
+ }
+ else {
+ m_RFailLED = LED_ON; m_GPassLED = LED_OFF; m_BBusyLED = LED_OFF;
//~ rgb_led.red(); // diagnostic rbg led RED
- rgb_led.green(); // diagnostic rbg led GREEN
- //~ rgb_led.blue(); // diagnostic rbg led BLUE
- //~ rgb_led.white(); // diagnostic rbg led RED+GREEN+BLUE=WHITE
- //~ rgb_led.cyan(); // diagnostic rbg led GREEN+BLUE=CYAN
- //~ rgb_led.magenta(); // diagnostic rbg led RED+BLUE=MAGENTA
- //~ rgb_led.yellow(); // diagnostic rbg led RED+GREEN=YELLOW
- //~ rgb_led.black(); // diagnostic rbg led BLACK
-#endif // USE_LEDS
}
}
@@ -583,4 +599,3 @@
// End of file
-