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: mbed
Fork of AnalogIn_HelloWorld_WIZwiki-W7500 by
Diff: main.cpp
- Revision:
- 6:885e2cb16d7d
- Parent:
- 5:97fa889845b0
- Child:
- 7:6b50af097b44
diff -r 97fa889845b0 -r 885e2cb16d7d main.cpp
--- a/main.cpp Fri Jul 24 01:48:17 2015 +0000
+++ b/main.cpp Tue Aug 04 06:46:01 2015 +0000
@@ -3,17 +3,14 @@
#include "mbed.h"
// Initialize a pins to perform analog input and digital output fucntions
-DigitalOut shield_led_off(D10); // LED_GREEN on easy module shield
AnalogIn ain(A0);
-DigitalOut myled_R(D9); // LED_RED on easy module shield
+DigitalOut myled_R(LED_RED); // LED_RED on WIZwiki-W7500
int main(void)
-{
- shield_led_off = 0; // turn off Green LED on shield
-
+{
while (1) {
- // If greater than 0.4 * VCC set the digital pin
+ // If greater than 0.5 * VCC set the digital pin
// to a logic 1 otherwise a logic 0
if(ain > 0.5f) {
myled_R = 1; // Red LED ON
@@ -22,6 +19,7 @@
}
// output the voltage and analog values
+ printf("======================\r\n");
printf("voltage value : %3.3f\r\n", ain.read()*3.3f);
printf("analog value : %3.3f\r\n", ain.read());
wait(1.0);
