Lab4

Dependencies:   mbed HeptaBattery HeptaTemp

Committer:
HEPTA
Date:
Sat Aug 17 08:41:00 2019 +0000
Revision:
16:022f6b8155ce
Parent:
14:71b3e6d7d41b
Child:
17:100ec053eb3b
Added sentence to make EN pin high

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:bdbd3d6fc5d5 1 #include "mbed.h"
HEPTA 14:71b3e6d7d41b 2 #include"HeptaTemp.h"
HEPTA 14:71b3e6d7d41b 3
HEPTA 14:71b3e6d7d41b 4 Serial pc(USBTX, USBRX);
HEPTA 14:71b3e6d7d41b 5 HeptaTemp temper(p17);
HEPTA 16:022f6b8155ce 6 DigitalOut EN(p26);
HEPTA 14:71b3e6d7d41b 7
umeume 2:1c5cdb2c3e0f 8 int main()
umeume 2:1c5cdb2c3e0f 9 {
HEPTA 16:022f6b8155ce 10 EN = 1; // EN pin : high
HEPTA 14:71b3e6d7d41b 11 pc.baud(9600);
HEPTA 14:71b3e6d7d41b 12 float temp;
HEPTA 14:71b3e6d7d41b 13 for (int i=0;i<10;i++) {
HEPTA 14:71b3e6d7d41b 14 temper.temp_sense(&temp);
HEPTA 14:71b3e6d7d41b 15 pc.printf("temp = %f\r\n",temp);
HEPTA 14:71b3e6d7d41b 16 wait(1.0);
HEPTA 14:71b3e6d7d41b 17 }
umeume 2:1c5cdb2c3e0f 18 }