Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. //file Motore.cpp
  2. #include "Arduino.h"
  3. #include "Motore.h"
  4.  
  5. Motore::Motore(int avPin,int indPin, int orAntiorPin, int onOffPin){
  6.   pinMode(avPin, INPUT);
  7.   pinMode(indPin, INPUT);
  8.   pinMode(orAntiorPin, OUTPUT);
  9.   pinMode(onOffPin, OUTPUT);
  10.  
  11.   _avPin = avPin;
  12.   _indPin = indPin;
  13.   _orAntiorPin = orAntiorPin;
  14.   _onOffPin = onOffPin;
  15.   }
  16.   void Motore::orario(){
  17.   digitalWrite(_orAntiorPin, HIGH);  
  18.   delay(50);
  19. }
  20.  
  21. void Motore::antiOrario(){
  22.   digitalWrite(_orAntiorPin, LOW);
  23.   delay(50);
  24. }
  25.  
  26. void Motore::spento(){
  27.   digitalWrite(_onOffPin, LOW);
  28.   delay(50);
  29. }
  30.  
  31. void Motore::acceso(){
  32.   digitalWrite(_onOffPin, HIGH);
  33.   delay(50);
  34. }
  35. int Motore::indPin(){
  36.   return _indPin;
  37. }
  38. int Motore::avPin(){
  39.   return _avPin;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement