Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Filoguidage.h>
- Filoguidage filoguidage;
- int pin = A11;
- void setup() {
- Serial.begin(115200);
- pinMode(pin,INPUT);
- filoguidage.init(pin,10,10);
- }
- void loop() {
- int test = filoguidage.getPosition();
- Serial.println(test);
- }
- #ifndef Filoguidage_h
- #define Filoguidage_h
- #include "Energia.h"
- class Filoguidage
- {
- public:
- void init(int PinCapteur,int valeurCentrale, int interval);
- int getPosition();
- private:
- int _PinCapteur;
- };
- #endif
- #include "Energia.h"
- #include "Filoguidage.h"
- void Filoguidage::init(int PinCapteur,int valeurCentrale,int interval){
- int _PinCapteur = PinCapteur;
- pinMode(_PinCapteur, INPUT);
- }
- int Filoguidage::getPosition(){
- return analogRead( _PinCapteur );
- }
Add Comment
Please, Sign In to add comment