Goal: Simulate the reactions of a nervous / lonely puppy using servo's + the mbed LPC1768.
Dependencies: mbed-rtos-edited mbed Servo C12832
nervousPuppy.cpp
- Committer:
- SeanDoyle
- Date:
- 2015-01-12
- Revision:
- 1:8fe6802d6971
- Parent:
- 0:f71b200c2f4d
- Child:
- 2:8415bea33a95
File content as of revision 1:8fe6802d6971:
#include "nervousPuppy.h" nervousPuppy::nervousPuppy(){ bool isRunning = true; while(isRunning){ if(isLonely()){} // MoveForward else if(isScared()){} //MoveBack } } bool nervousPuppy::isLonely(){ if(playerDistance > LONELY)return true; else return false; } bool nervousPuppy::isScared(){ if(playerDistance < SCARED)return true; else return false; } float nervousPuppy::getPlayerDistance(){ return playerDistance; } void nervousPuppy::setPlayerDistance(float dist){ playerDistance = dist; } int main(){ nervousPuppy(); }