sdf

Dependencies:   mbed C12832 Servo RangeFinder Pulse

Committer:
asimelfadil
Date:
Tue Mar 01 13:49:18 2022 +0000
Revision:
1:47dc87d326ed
Parent:
0:4db5f0f5faa0
Group 66 Course Work 2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
asimelfadil 0:4db5f0f5faa0 1 #include <mbed.h>
asimelfadil 0:4db5f0f5faa0 2 #include <MoistureSensor.h>
asimelfadil 0:4db5f0f5faa0 3
asimelfadil 0:4db5f0f5faa0 4
asimelfadil 0:4db5f0f5faa0 5
asimelfadil 0:4db5f0f5faa0 6 moisture_sensor::moisture_sensor(PinName pin) : _pin(pin)
asimelfadil 0:4db5f0f5faa0 7 {
asimelfadil 0:4db5f0f5faa0 8 // _pin(pin) means pass pin to the AnalogIn constructor
asimelfadil 0:4db5f0f5faa0 9 }
asimelfadil 0:4db5f0f5faa0 10 moisture_sensor::~moisture_sensor ()
asimelfadil 0:4db5f0f5faa0 11 {
asimelfadil 0:4db5f0f5faa0 12 }
asimelfadil 0:4db5f0f5faa0 13 float moisture_sensor::read()
asimelfadil 0:4db5f0f5faa0 14 {
asimelfadil 0:4db5f0f5faa0 15 //read moisture sensor
asimelfadil 0:4db5f0f5faa0 16 return _pin.read();
asimelfadil 0:4db5f0f5faa0 17 }
asimelfadil 0:4db5f0f5faa0 18
asimelfadil 0:4db5f0f5faa0 19 /*
asimelfadil 0:4db5f0f5faa0 20 float moisture_sensor:getCurrentmoisture_sensor()
asimelfadil 0:4db5f0f5faa0 21 {
asimelfadil 0:4db5f0f5faa0 22 currentMoistureSensor = Moisturelevelreading.read()
asimelfadil 0:4db5f0f5faa0 23 return Moisture_Sensorreading;
asimelfadil 0:4db5f0f5faa0 24 }
asimelfadil 0:4db5f0f5faa0 25 */