revised code

Dependencies:   mbed

Committer:
nmaududi
Date:
Sat Oct 05 21:17:17 2019 +0000
Revision:
2:64a34ae90bb1
Parent:
0:4fb921928934
revised version for module 4;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nmaududi 0:4fb921928934 1 /**-----------------------------------------------------------------------------
nmaududi 0:4fb921928934 2 \file shared.h
nmaududi 0:4fb921928934 3 -- --
nmaududi 0:4fb921928934 4 -- ECEN 5803 Mastering Embedded System Architecture --
nmaududi 0:4fb921928934 5 -- Project 1 Module 4 --
nmaududi 0:4fb921928934 6 -- Microcontroller Firmware --
nmaududi 0:4fb921928934 7 -- shared.h --
nmaududi 0:4fb921928934 8 -- --
nmaududi 0:4fb921928934 9 -------------------------------------------------------------------------------
nmaududi 0:4fb921928934 10 --
nmaududi 0:4fb921928934 11 -- Designed for: University of Colorado at Boulder
nmaududi 0:4fb921928934 12 --
nmaududi 0:4fb921928934 13 --
nmaududi 0:4fb921928934 14 -- Designed by: Tim Scherr
nmaududi 0:4fb921928934 15 -- Revised by: Student's name
nmaududi 0:4fb921928934 16 --
nmaududi 0:4fb921928934 17 -- Version: 2.1
nmaududi 0:4fb921928934 18 -- Date of current revision: 2017-09-25
nmaududi 0:4fb921928934 19 -- Target Microcontroller: Freescale MKL25ZVMT4
nmaududi 0:4fb921928934 20 -- Tools used: ARM mbed compiler
nmaududi 0:4fb921928934 21 -- ARM mbed SDK
nmaududi 0:4fb921928934 22 -- Freescale FRDM-KL25Z Freedom Board
nmaududi 0:4fb921928934 23 --
nmaududi 0:4fb921928934 24 --
nmaududi 0:4fb921928934 25 -- Functional Description: Header file for all globals
nmaududi 0:4fb921928934 26 --
nmaududi 0:4fb921928934 27 -- Copyright (c) 2015, 2016 Tim Scherr All rights reserved.
nmaududi 0:4fb921928934 28 --
nmaududi 0:4fb921928934 29 */
nmaududi 0:4fb921928934 30
nmaududi 0:4fb921928934 31
nmaududi 0:4fb921928934 32 #include "shared.h"
nmaududi 0:4fb921928934 33
nmaududi 0:4fb921928934 34 void PwmOutputs_flowmeter(void){
nmaududi 0:4fb921928934 35
nmaududi 0:4fb921928934 36 PwmOut FLOW_4_20(PTE30);
nmaududi 0:4fb921928934 37
nmaududi 0:4fb921928934 38 FLOW_4_20.period(1/flow); // set PWM pulses proportion to the frequency outputs
nmaududi 0:4fb921928934 39 FLOW_4_20 = 0.5; // set duty cycle to 50% for the PWM pulses
nmaududi 0:4fb921928934 40
nmaududi 0:4fb921928934 41 }
nmaududi 0:4fb921928934 42
nmaududi 0:4fb921928934 43 void Pulse_Output_Frequency(void){
nmaududi 0:4fb921928934 44
nmaududi 0:4fb921928934 45 PwmOut Frequency_4_20(PTE31); // TMP0 channel 4 used to display the pulsed outputs
nmaududi 0:4fb921928934 46 Frequency_4_20.period(1/freq_value); // set PWM pulses proportion to the frequency outputs
nmaududi 0:4fb921928934 47 Frequency_4_20=0.5; // set duty cycle to 50% for the PWM pulses
nmaududi 0:4fb921928934 48
nmaududi 0:4fb921928934 49 }