<< Click to Display Table of Contents >> Web ADC wtih W2D |
|
demo File: web_adc.mdl
This model is for target STM32F4 Discovery, update model then build to program to target board. See here for Setup Blocks information.
Using Waijung WebPage Designer (W2D) tool to make a web interface for reading ADC value into Text Output and Chart. 4 LEDs on MCU webserver will change as the ADC value changes. You also have an Override Switch to directly control the Blue LED.
Drag & Drop 2 Frames, 2 Display Labels, 1 ON-OFF Switch, 1 Text Input and 1 Chart into Drop Target.
Configure each item using the following information. Notice the order of each item id. More details here.
WebPage interface show ADC Value read from SQLite table as Text Output and Chart. Text Output refresh every 500 ms and Chart reload every 1000 ms. The ADC pin CO is connect to aMG Photocell - A Vsense reading ADC value between 0V (Bright) and 3.3V (Dark) according to the light ambient.
When ADC value read >= 1.5V Green LED is on.
When ADC value read >= 1.9V Green and Orange LEDs are on.
When ADC value read >= 1.5V Green, Orange and Red LEDs are on.
When ADC value read >= 1.5V Green, Orange, Red and Blue LEDs are on.
Once you press Blue LED Override Switch ON, the Blue LED will light up no matter what the ADC value is.