Final version of program with changed pin for PWM, freq for led and bluetooth comma seperated values

Dependencies:   mbed TextLCD

main.cpp

Committer:
farhan_saeed
Date:
2018-11-30
Revision:
7:871a3d9dc680
Parent:
6:22673b8098a0

File content as of revision 7:871a3d9dc680:

#include "stdafx.h"

TextLCD lcd(PTC7,PTC0,PTC3,PTC4,PTC5,PTC6);
AnalogIn temp_sen(A0);
AnalogIn light_sen(A1);
PwmOut pwm(PTE20);
PwmOut led_o(PTB18);
Serial mobile(PTE22, PTE23);
DigitalIn enter(D8);
DigitalIn down(D9);
DigitalIn up(D10);
DigitalIn back(D11);


int state = 0;
int type = 0;
int low = 16;
int high = 32;
int bl_vl = 1;
int fanLevel_man = 3;
int lightLevel_man = 2;
int temp_measure;
int fanLevel_dis;
int lightLevel_dis;
int point = 0;
bool modeStatus = true;

int main()
{
    while(1) {
        //modeProcess();
        if (state == 0) {
            mainScreen();
            mobile.printf("%i,%i,%i\n",temp_measure,fanLevel_dis,lightLevel_dis);
            //mobile.printf("%i",temp_measure);
        }
        if (state == 1) {
            optionScreen();
        }
        if (state == 2) {
            temperatureScreen();
        }
        if (state == 3) {
            lightScreen();
        }
        if (state == 4) {
            fanScreen();
        }
        if (state == 5) {
            modeScreen();
        }
    }
}