
CYW954907AEVAL1F Evaluation Kit User Guide, Doc. No. 002-22338 Rev. **
51
Code Examples
5.4
ADC_measure
5.4.1
5.4.1 Project Description
This project demonstrates measuring values from the external ADC chip on the board and posting
the values to a web page accessible from the WLAN network. This code example is based on exist-
ing code example (
apps/demo/temp_contro
l) available in the WICED Studio 6.0 (or later) . On
startup, the adc_measure code example joins the Wi-Fi Access Point specified in the
wifi_con-
fig_dct.h
file and starts a web page where the ADC count is reported.
The project consists of the following files:
■
adc_measure.c
: This file contains the main application function application_start() which is the
entry point and execution of the firmware application. It also contains the function definitions for
initializing, conducting ADC measurement, starting the web page, and processing an ADC
update.
■
adc_measure.mk
: This is the makefile which adds the sources, components (in this application,
component HTTP_server, device_configuration, Xively, SNTP and Gedday are used) and the
name of the application. It also adds the required resources for the web page which is available in
the
resources/apps
directory.
■
i2c.c:
This file contains the required function definitions for initializing and taking ADC samples
from the external ADC (MAX 11615) available in the CY9W54907AEVAL1F EVK.
■
wifi_config_dct.h:
This file contains the Wi-Fi Access Point credentials (SSID and pass
phrase key) and soft AP credentials. Enter the client access point name and password creden-
tials prior to building the application. These are specified as CLIENT_AP_SSID and CLI-
ENT_AP_PASSPHRASE. Note that the security type may also have to be changed if the access
point does not use WPA2 security. The Wi-Fi access point must be connected to the internet to
get the current time using Network Time protocol (NTP). If the Wi-Fi access point is not con-
nected to the internet, then it will assume 00:00:00 UTC time and will start the web page.