6
int onSpeed = 200; // a number between 0 (stopped) and 255 (full speed)
int onTime = 2500;
int offSpeed = 50; // a number between 0 (stopped) and 255 (full speed)
int offTime = 1000;
analogWrite(motorPin, onSpeed);
delay(onTime);
analogWrite(motorPin, offSpeed);
delay(offTime);
}
void motorAcceleration()
{
int delayTime = 50;
for(int i=0; i<256; i++)
{
analogWrite(motorPin, i);
delay(delayTime);
}
for(int i=255; i>=0; i--)
{
analogWrite(motorPin, i);
delay(delayTime);
}
}
With Raspberry Pi
1. You should have got a raspberry pi and a grovepi or .
2. You should have completed configuring the development enviroment, otherwise follow
here
.
3. Connection
.
Plug the sensor to grovepi socket D6 by using a grove cable.
4. Navigate to the demos' directory:
cd yourpath/GrovePi/Software/Python/
To see the code
nano grove_mosfet.py # "Ctrl+x" to exit #
import time
import grovepi
Содержание Grove MOSFET
Страница 2: ...2 Document Revision History Revision Date Author Description 1 0 Sep 22 2015 Jiankai li Create file ...
Страница 6: ...3 2 Specification Working voltage 5V Vin 5 15V MOSFET Model CJQ4435 ...
Страница 7: ...4 3 Interface Vin accepts 5V 15V power of which current is less than 2A Vout attach actuators here ...
Страница 11: ...8 5 Resource Grove MOSFET Eagle File CJQ4435 Datasheet MOSFET_WIKI Getting started with Arduino ...