Potentiometrillä ohjattu DC-moottori DC-motor controlled by potentiometer

Dependencies:   microbit

Committer:
tyynetyyne
Date:
Thu Aug 16 10:42:18 2018 +0000
Revision:
0:5d161ce7187b
Potentiometrill? ohjattu dc-moottori;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tyynetyyne 0:5d161ce7187b 1
tyynetyyne 0:5d161ce7187b 2 #include "MicroBit.h"
tyynetyyne 0:5d161ce7187b 3
tyynetyyne 0:5d161ce7187b 4 MicroBit uBit;
tyynetyyne 0:5d161ce7187b 5 int arvo = 0;
tyynetyyne 0:5d161ce7187b 6
tyynetyyne 0:5d161ce7187b 7 int main()
tyynetyyne 0:5d161ce7187b 8 {
tyynetyyne 0:5d161ce7187b 9 uBit.init();
tyynetyyne 0:5d161ce7187b 10 while(1){
tyynetyyne 0:5d161ce7187b 11 arvo = uBit.io.P1.getAnalogValue();
tyynetyyne 0:5d161ce7187b 12 uBit.io.P0.setAnalogValue(arvo);
tyynetyyne 0:5d161ce7187b 13 uBit.sleep(1);
tyynetyyne 0:5d161ce7187b 14 }
tyynetyyne 0:5d161ce7187b 15 }