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

Dependencies:   mbed TextLCD

main.cpp

Committer:
osamugint
Date:
2018-11-28
Revision:
6:22673b8098a0
Parent:
4:28134b3439bc
Child:
7:871a3d9dc680

File content as of revision 6:22673b8098a0:

#include "stdafx.h"

TextLCD lcd(PTC7,PTC0,PTC3,PTC4,PTC5,PTC6);
AnalogIn temp_sen(A0);
AnalogIn light_sen(A1);
PwmOut pwm(A2);
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("temp: %i fan: %i light: %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();
        }
    }
}