Home
Me–Electronic Modules User Manual
Contents
1. 10 iE XEM FEU E E EN 10 EE EE 10 2 Electronic Module Library Introduction 11 2 1 Arduino Programming Environment 11 www makeblock cc I 2 2 Me Electronic Module Programming Library 11 2 291 TODO 11 2 2 2 Description of each Electronic Module Library 12 3 Electronic Module Library 13 3 1 BaseShield Library 13 3 1 1 function 1 13 3 1 2 setMePortOutsidePin 14 3 1 3 setMePortlInnersidePin function 14 341 4 setMePort TUNCHON cii ooa tte t a cereais ai 14 3 1 5 readMePortOutsidePin function 15 3 1 6 readMePortInnersidePin 22 15 3 1 7 readMePort 15 3 1 8 readAnalogMePortOutsidePin function 16 3 1 9 readAnalogMePortlnnersidePin function 16 3 1 10 readAnalogMePort 16 17 3 2 Me_BaseShieldMotorDriver Library functions
2. Me Electronic Modules User Manual 2011 Hulu Root Technology Co Ltd 04 2013 Rev 1 0 by Eric Makeblxtck Contents 1 Introduction of Me electronic modules eere 1 1 1 Me Electronic Modules 1 1 2 MVE GUNG PROS 2 Pea 2 __ __ _ 2 1 3 SENG scares 2 22 3 Usa 159 3 1 3 4 Specifications for connectors 3 1 4 Me Motor DIVE ueste vri 5 ME TU 5 m EU 5 1 4 3 5 1 5 Me 5ervo DFIVOl 6 15251 6 6 15 3 Power SUDDIY re ee 6 1 6 Me 7 7 U Ope EE E 7 1 7 Infrared 8 EAL _______ 8 _______ _ _ _ _ 8 1 8 Wire I FIN 9 Load FOUT _________ 9 6 9 1 9 UltraSonic
3. 34 3 7 3 readSensor2 35 3 7 4 function 35 SNO MEZ e eee 35 3 8 Me UltraSonicSensor Library functions 36 3512 36 www makeblock cc Ul Makeblixtck 3 8 2 distanceCm function 36 3 8 3 distancelnch function 37 ane ERU T M 37 www makeblock cc IV 1 Introduction of electronic modules 1 1 Me Electronic Modules Module Name Introduction ES Meduino is Arduino compatible board Based on Uno R3 Meduino Schematic 10096 compatible to its existing program shield and IDEs The Me Base Shield is an Arduino Shield that brings out most of the Arduino Pins to the uniform 4pin RJ10 connectors You can easily connect the other Me Modules to the Arduino through the Base Shield Me Base Shield The Me Motor Driver is designed to drive one 6 12 Me Motor Dri ROM er DC geared motor Me Servo Driver The Me Servo Driver is designed to drive servo motors The Me Bluetooth is designed to connect with mobile Me Bluetooth e phones by using the specific APP The Me Infrared Receiver module is designed for controlling the robotics by receiving the commands from the infrared remote control Me Infrared Receiver The Me Line Finder module is designed for the line Me Line Finder following robotics
4. 18 3 2 1 runMotor1 function 18 3 2 2 runMotor2 function 19 2 223 19 3 24 550 TUNCUON 20 3 2 5 stopMotor2 1 20 3 2 6 stopMotors function 1 4 0 74 20 327 TREE 20 3 3 Me_MotorDriver Library functions 21 22021 COUT 21 ay 21 222 22 22 3 4 ServobDriver 23 3 4 1 Servos begin 1 1 1 24 3 4 2 5 1 begin function 1 4 141 24 3 4 3 Servo2 begin FUNCTION 14 24 3 4 4 detachServol function 25 www makeblock cc II 3 4 5 detachServo2 function 25 SAG detacnAl TUMCTIOM En 25 3 4 writeServol TUNCUON 25 3 4 8 writeServo2 26 3 4 9 writeServolMicroseconds function
5. 26 3 4 10 writeServo2Microseconds function 26 3 4 11 1 26 34 12 2 TUNCUIONM sssinnedercrsesasiacsarorsaiooncacwenaersabysereeaiceeks 27 3 4 13 readServolMicroseconds function 27 3 4 14 readServo2Microseconds function 27 3 4 15 servolAttached function 27 3 4 16 servo2Attached 28 DAAL EKIDI 28 3 5 Bluetooth Library functions 29 29 2 542 29 3 5 3 WHITE TUN CUO rok tr VR Sao qu YER XU DS Saw PI Pe ES 30 3 5 4 30 3 5 5 available function _____ 30 9 5 0 aaeeneyseveeinseed 31 3 5 7 checkConnected 31 0 POMPE 31 3 6 Me InfraredReceiver Library lt 32 3 6 1 function 1 1 11 2 nenne 32 302 tread TUBELIO 32 _ 32 3 7 Me LineFinder Library functions 34 Balak PERIN TUNG RTT 34 3 7 2 readSensor1
6. a 3 4 14 readServo2Microseconds function Table 38 describes the readServo2Microseconds function Table 38 readServo2Microseconds function The current pulse width microseconds for Servo2 3 4 15 servolAttached function Table 39 describes the servo1Attached function Table 39 readServo1 function Function prototype bool servo1Attached Behavior description Check whether the Servo1 variable is attached to a pin Return parameter True if Servo1 is attached otherwise false www makeblock cc 2 3 4 16 servo2Attached function Table 40 describes the servo2Attached function Table 40 servo2Attached function Function prototype bool servo2Attached Behavior description Check whether the Servo2 variable is attached to a pin Return parameter True if Servo2 is attached otherwise false 3 4 17 Example Open the Arduino IDE and open the sketch of Me ServoDriver TestServoDriver The sketch will control the motor connected to the driver board running in two directions and then stop www makeblock cc 28 3 5 Me_Bluetooth Library functions Me_Bluetooth Library is designed for connecting with the mobile phone or other Bluetooth devices using the Me_Bluetooth module Class Me_Bluetooth Users can specify PORT_3 PORT_4 PORT_5 or PORT_6 when instantiation an object Table 41 lists the Me_ Bluetooth Library main member function Table 41 Me_Bluetoot
7. Receiver Lego Analog Bridge Infrared Receiver Lego Analog Bridge 1 4 Me Motor Driver The Me Motor Driver is designed to drive one 6 12 DC geared motor 1 4 1 Features 9 12VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield 2 signal controlling motor direction and speed One 2A current output channel Over current protection Labeled with red tag 16mm interval M4 mounting holes compatible with Makeblock beams Compact size 2 4cmx4 8cm LED indicator PWR Red LED Power indicator PWM Blue LED PWM indicator DRC Blue LED Direction indicator 1 4 2 Usage As the Red tag illustrated the Me Motor Driver can be connected to the port 1 or 2 of the Me Base Shield by an telephone wire Connect the DC motor to the yellow terminal which is the output of the motor driver 1 4 3 Power supply When connected the Me Motor Driver can be powered by the 9 12V DC power from the port 1 or 2 of the Me Base Shield www makeblock cc 1 5 Servo Driver The Me Servo Driver is designed to drive servo motors 1 5 1 Features 9 12VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield Two PWM output channels for controlling two servo motors The power voltage for servos are regulated to 6V Labeled with red tag 16mm interval M4 mounting holes compatib
8. 3 innersideADValue int The returned value of variant Return parameter2 innersideADValue can 071023 3 1 11 Example Open the Arduino IDE there is a demo sketch for Me BaseShield Open the sketch of Me BaseShield gt ReadAndWriteBaseShieldPort The sketch change the state of pins from PORT 1 to PORT 8 www makeblock cc 17 3 2 Me_BaseShieldMotorDriver Library functions The Me BaseShield MotorDriver Library is designed to drive two 6712 DC geared motors by connecting them with the yellow terminal M1 M1 and M2 M2 on Me Base Shield Class Me BaseShieldMotorDriver No parameters needed when instantiation an object Table 13 lists the Me MotorDriver Library main member function Table 13 Me MotorDriver Library functions Function name Description Control the motor connected to the yellow terminal M1 runMotor1 M1 Control the motor connected to the yellow terminal M2 runMotor2 M2 Control the two motors connected to the onboard motor runMotors driver Make the motor connected to the yellow terminal M1 M1 stopMotor1 stop running Short brake Make the motor connected to the yellow terminal M2 M2 stopMotor2 stop running Short brake Make the two motors stop running Short brake 3 2 1 runMotor1 function Table 14 describes the runMotor1 function Table 14 runMotor1 function Function name runMotor1 Function Function prototyp
9. 6 IR BUTTON 7 IR BUTTON 8 IR BUTTON 9 N N UJ 09 www makeblock cc 3 7 Me_LineFinder Library functions Me_LineFinder library is designed for the line following robotics of the Me_LineFinder module Class Me_LineFinder Users can specify PORT_3 PORT_4 PORT_5 or PORT_6 when instantiation an object Table 52 lists the Me Bluetooth Library main member function Table 52 LineFinder Library functions Function name Description Dos Initialize the state of connected and unconnected ports of egin Base Shield Read the status of Sensor1 Read the status of Sensor2 Read the status of the two sensors 3 7 1 begin function Table 53 describes the begin function Table 53 begin function Function prototype void begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 7 2 readSensor1 function Table 54 describes the readSensor1 function Table 54 readSensor1 function Function prototype int readSensor1 Behavior description Read the status of Sensor1 Input parameter The status of Sensor1 HIGH when receiving reflective Return parameter signal LOW when finding black line www makeblock cc 34 3 7 3 readSensor2 function Table 55 describes the readSensor2 function Table 55 readSensor2 function Function prototype int readSensor2 Behavior description Read the status of
10. DC JACK of Base Shield Otherwise there ll be no power for PORT 1 and 2 There s a switch on the Shield for controlling the power ON OFF Me Base Shield eo es gt c Battery Bracket Meduino 1 3 4 Specifications for connectors 8 RJ10 connectors in total The tags on the connectors have 5 types of color Check the following table for the detail function and attribute of each connector www makeblock cc 3 Table 1 Connectors detail function and attribute PORT Tae Color Compatible No 5 Module types 1 Red 9 12VDC driven modules Red 9 12VDC driven modules 1 or 2 way gt digital modules 1 or 2 way 4 Blue amp Orange digital modules Blue amp Orange EDI EN 5 digital or analog amp Black amp Green modules Blue amp Orange d A Way 6 digital or analog amp Black amp Green modale 1 way digital or 7 Green amp Orange analog modules 1 way digital or 8 Green amp Orange analog modules www makeblock cc Typical Me Modules Motor Driver Servo Driver Lego Motor Bridge Motor Driver Servo Driver Lego Motor Bridge Line Finder Bluetooth Infrared Receiver Lego Digital Bridge Line Finder Bluetooth Infrared Receiver Lego Digital Bridge Line Finder Bluetooth Infrared Receiver Lego Digital Bridge Lego Analog Bridge Line Finder Bluetooth Infrared Receiver Lego Digital Bridge Lego Analog Bridge Infrared
11. Sensor2 The status of Sensor2 HIGH when receiving reflective Return parameter m signal LOW when finding black line 3 7 4 readSensors function Table 56 describes the readSensors function Table 56 readSensors function Four statuses 51 IN S2 IN Sensor1 and Sensor2 are both inside of black line S1 IN S2 OUT Sensor1 is inside of black line and Sensor2 is outside of black line 51 OUT S2 Sensor1 is outside of black line and Sensor2 is inside of black line 51 OUT S2 OUT Sensor1 is outside of black line and Sensor2 is outside of black line Return parameter 3 7 5 Example Open the Arduino IDE and open the sketch of Me LineFinder TestLineFinder The sketch will detect the black line and print it to the serial www makeblock cc 35 3 8 Me_UltraSonicSensor Library functions Me_UltraSonicSensor library is designed for distance measurement using the Me UltrasonicSensor module Class Me UltraSonicSensor Users can specify PORT 3 PORT 4 PORT 5 PORT 6 PORT 7 PORT 8 when instantiation an object Table 57 lists the Me MotorDriver Library main member function Table 57 MotorDriver Library functions Function name Description Initialize the state of connected and unconnected ports of Begin Base Shield Read the distance in centimeters distancelnch Read the distance in inches 3 8 1 begin function Table 58 describes the begin function Table 58 b
12. The Me UltraSonic Sensor module is designed for distance measurement or obstacle avoidance of the robotics Me UltraSonic Sensor www makeblock cc 1 1 2 Meduino Meduino is Arduino compatible board Based on Uno R3 Schematic 100 compatible to its existing program shield and IDEs DIGITALCPUn Meduino v1 0 by Makeblock _ ON 1 17 2013 gt 4 B 1 2 1 Features More details about Arduino Uno R3 visit following webpage htto arduino cc en Main ArduinoBoardUno 1 2 2 Usage Plug the Base Shield to the Meduino then it can connect with other Me Electronic Modules 1 3 Me Base Shield The Me Base Shield is an Arduino Shield that brings out most of the Arduino Pins to the uniform 4pin RJ10 connectors You can easily connect the other Me Modules to the Arduino through the Base Shield www makeblock cc 2 1 3 1 Features 6 10VDC power supply Compatible with Arduino Uno R3 Arduino Leonardo Arduino Due Arduino Mega and other Arduino compatible board Two channel motor driver integrated M1 M2 1 2A ave 3 2A peak current for each channel Intuitive connection by labeling tags with different color and number for each connector 1 3 2 Usage Plug the Base Shield to the Meduino or Arduino compatible board 1 3 3 Power supply It is suggested to power the board by connecting 9V 12VDC to the
13. able 20 Me_MotorDriver Library functions Function name Description Initialize the state of connected and unconnected ports of begin Base Shield Control the speed and direction of the motor connected to the driver board Make the motor stop running Short brake 3 3 1 begin function Table 21 describes the begin function Table 21 begin function Function prototype void begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 3 2 function Table 22 describes the run function Table 22 function Function prototype void run int speed Control the speed and direction of the motor connected to Behavior description the driver board speed int The value can from 255 to 255 having motor Input parameter running with highest speed from one direction to the opposite direction Return parameter www makeblock cc 21 3 3 3 stop function Table 23 describes the stop function Table 23 stop function Function prototype void stop Behavior description Make the motor stop running Short brake 3 3 4 Example Open the Arduino IDE and open the sketch of Me MotorDriver gt TestMotorDriver The sketch will control the motor connected to the driver board running in two directions and then stop www makeblock cc 22 3 4 Me_ServoDriver Me_ServoDriver library is designed for c
14. ailable function Function prototype int available Get the number of bytes characters available for reading Behavior description from the serial port Return parameter The number of bytes available to read www makeblock cc 30 3 5 6 flush function Table 47 describes the flush function Table 47 flush function Function prototype void flush 3 5 7 checkConnected function Wait for the transmission of outgoing serial data to Behavior description complete Table 48 describes the checkConnected function Table 48 checkConnected function Function name checkConnected Function prototype int checkConnected Behavior description Check the connected between the master and the slave The state of the Bluetooth BLUETOOTH CONNECTED or Return parameter BLUETOOTH_PAIRABLE 3 5 8 Example Open the Arduino IDE and open the sketch of Me Bluetooth gt TestSlaveBluetoothBySoftSerial The sketch will control the motor connected to the driver board running in two directions and then stop www makeblock cc 31 3 6 Me_InfraredReceiver Library functions Me_InfraredReceiver library is designed for receiving the command from the infrared remote control of the Me_InfraredReceiver module Class Me_InfraredReceiver Users can specify PORT_3 PORT_4 PORT_5 PORT_6 PORT_7 or PORT_8 when instantiation an object Table 49 lists the Me InraredReceiver Library main memb
15. block cc 19 3 2 4 stopMotor1 function Table 17 describes the stopMotor1 function Table 17 stopMotor1 function Function name stopMotor1 Function prototype void stopMotor1 Make the motor connected to the yellow terminal M1 1 Behavior description stop running Short brake 3 2 5 stopMotor2 function Table 18 describes the stopMotor2 function Table 18 stopMotor2 function Function name stopMotor2 Function prototype void stopMotor2 Make the motor connected to the yellow terminal M2 M2 Behavior description stop running Short brake 3 2 6 stopMotors function Table 19 describes the stopMotors function Table 19 stopMotors function Function name stopMotors Function prototype void stopMotors Behavior description Make the two motors stop running Short brake 3 2 7 Example Open the Arduino IDE there is a demo sketch for Me BaseShieldMotorDriver Open the sketch of Me BaseShieldMotorDriver TestBaseShieldMotorDriver The sketch controls two motors connected to the onboard motor driver running in two directions and then stop www makeblock cc 20 3 3 Me_MotorDriver Library functions Me_MotorDriver library is designed for controlling motors with Me_MotorDriver module Class Me_MotorDriver Users can specify PORT_1 or PORT_2 when instantiation an object Table 20 lists the Me MotorDriver Library main member function T
16. dAnalogMePortlnnersidePin Read the inner side pin state of Me Port readAnalogMePort Read the analog pins value of Me Port 3 1 1 begin function Table 3 describes the begin function Table3 begin function Function prototype void begin Behavior Initialize the onboard motor driver and the PORT 1 to description PORT 8 Input parameter Return parameter www makeblock cc 13 3 1 2 setMePortOutsidePin function Table 4 describes the setMePortOutsidePin function Table 4 setMePortOutsidePin function Function name setMePortOutsidePin Function prototype void setMePortOutsidePin int port int state Behavior description Set the state for the outside pin of Me Port Input parameter1 port int The port can be PORT 1 to PORT 8 state int The variant outsidePinState can be HIGH 1 or Input parameter2 LOW O 3 1 3 setMePortlnnersidePin function Table 5 describes the setMePortlnnersidePin function Table 5 setMePortinnersidePin function State int The variant innersidePinState can be HIGH 1 or Input parameter2 LOW O 3 1 4 setMePort function Table 6 describes the setMePortlnnersidePin function Table 6 setMePortinnersidePin function void setMePort int port int outsidePinState 1 int Function prototype innersidePinState 1 Behavior description Set the state for the pins of Me Port port int There are two signal pins outside and inner side for I
17. e void runMotor1 int void 00000000 the motor connected to the yellow terminal LI Behavior description spd The value can from 255 to 255 having motor Input parameter running with highest speed from one direction to the opposite direction www makeblock cc 18 3 2 2 runMotor2 function Table 15 describes the runMotor2 function Table 15 runMotor2 function Function prototype void runMotor2 int spd Control the motor connected to the yellow terminal M2 Behavior description 2 spd int The value can from 255 to 255 having motor Input parameter running with highest speed from one direction to the opposite direction 3 2 3 runMotors function Table 16 describes the runMotors function Table 16 runMotors function Function prototype void runMotors int 15 int M2spd Control the two motors connected to the onboard motor Behavior description driver 1 lt int 15 represent the speed and direction of the Motor1 being controlled The value can from 255 to 255 Input parameter1 having motor running with highest speed from one direction to the opposite direction 2 lt int M2Spd represent the speed and direction of the Motor2 being controlled The value can from 255 to 255 Input parameter2 having motor running with highest speed from one direction to the opposite direction www make
18. egin function Function prototype void begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 8 2 distanceCm function Table 59 describes the distanceCm function Table 59 distanceCm function Function prototype long distanceCm Behavior description Read the distance in centimeters Return parameter The distance in centimeters www makeblock cc 36 3 8 3 distancelnch function Table 60 describes the distancelnch function Table 60 distancelnch function Function name distancelnch Function prototype long distancelnch Behavior description Read the distance in inches Return parameter The distance in inches 3 8 4 Example Open the Arduino IDE and open the sketch of Me UltraSonicSensor gt TestUltrasonicSensor The sketch will read the distance from the ultrasonic sensor and print it to the serial port in centimeters www makeblock cc 37
19. er function Table 49 Me_InrareadReceiver Library functions Function name Description Initialize the state of connected and unconnected ports of Begin Base Shield Read the button name from the infrared remote control 3 6 1 begin function Table 50 describes the begin function Table 50 begin function Function prototype void begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 6 2 read function Table 51 describes the read function Table 51 read function Function prototype 11116 t read Behavior description Read the code number from the infrared remote control Return parameter The code number of the IR control 3 6 3 Example Open the Arduino IDE and open the sketch of Me InfraredReceive gt TestinfaredReceiver The sketch will read the code number from the infrared remote control and print the button name to the serial port www makeblock cc 32 5 f 3 ct D ct 2 et Button Button Name Code Number POWER BUTTON 100 MENU BUTTON 102 TEST BUTTON 103 IR PLUS BUTTON 104 RETURN BUTTON 105 PREVIOUS BUTTON 106 PLAY BUTTON 107 IR NEXT BUTTON 108 BUTTON 0 5 BUTTON BUTTON gt gt IR BUTTON 1 BUTTON 2 IR BUTTON 3 BUTTON 4 IR BUTTON 5 BUTTON
20. h Library functions Function name Description Initialize the state of connected and unconnected ports of Begin Base Shield Get the number of bytes characters available for reading available from the serial port Wait for the transmission of outgoing serial data to complete cheackConnected Check the connected between the master and the slave 3 5 1 begin function Table 42 describes the begin function Table 42 begin function Function prototype void begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 5 2 setName function Table 43 describes the setName function Table 43 setName function www makeblock cc 29 Function name setName Function prototype int setName String name Behavior description Set device name as abcdefg name String The name of the device The state weather the name is set successfully or not 1 for Return parameter SUCCESS 3 5 3 write function Table 44 describes the write function Table 44 write function size t write uint8 t byte write will return the number of bytes written though Return parameter reading that number is optional 3 5 4 read function Table 45 describes the read function Table 45 read function input parameter None The character read or 1 if none is available 3 5 5 available function Table 46 describes the available function Table 46 av
21. ide for each of PORT 7 and PORT 8 outsidePinState int The variant outsidePinState can be Return parameter1 returned HIGH 1 or LOW O innersidePinState int The variant innersidePinState can Return parameter2 be returned HIGH 1 or LOW O 3 1 8 readAnalogMePortOutsidePin function Table 10 describes the readAnalogMePortOutsidePin function Table 10 readAnalogMePortOutsidePin function 3 1 9 readAnalogMePortlInnersidePin function Table 11 describes the readAnalogMePortInnersidePin function Table 11 readAnalogMePortlnnersidePin function readAnalogMePortInnersidePin Function prototype void readAnalogMePortlInnersidePin int port Behavior description Read the inner side analog pin value of Me Port port int The port can be PORT 1 to PORT 6 The returned value can be HIGH 1 or LOW 0 3 1 10 readAnalogMePort function Table 12 describes the readAnalogMePort function www makeblock cc 16 Table 12 readAnalogMePort function void readAnalogMePort int port int outsideADValue NULL Function prototype int innersideADValue NULL Behavior description Read the analog pins value of Me Port port int There are two signal pins outside and inner side for Input parameter each of PORT 1 to PORT 6 and one signal pin outside for each of PORT 7 and PORT 8 outsideADValue int The returned value of variant Return parameter1 outsideADValue 07102
22. inking indicates waiting to be paired Always ON indicates the connection has been established 1 6 2 Usage As the Blue tag illustrated the Me Servo Driver can be connected to the port 3 4 5 or 6 of the Me Base Shield by a telephone wire www makeblock cc 7 1 7 Infrared Receiver The Me Infrared Receiver module is designed for controlling the robotics by receiving the commands from the infrared remote control The IR detector have a demodulator inside that looks for modulated IR at 38 KHz The Infrared Receiver can receive signals well within 10 meters 1 7 1 Features Power Supply 5VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield Transmission Distance 10 meters in free space LED indicator PWR Red LED Power indicator Blinking while receiving infrared Signals 1 7 2 Usage As the Yellow tag illustrated the Me Infrared Receiver can be connected to the port 3 4 5 6 7 or 8 of the Me Base Shield by a telephone wire Infrared remote control 2 0 9 9 2 5 www makeblock cc 8 1 8 Me Line Finder The Me Line Finder module is designed for the line following robotics It has two sensors on the module and each sensor contains two parts an IR emitting LED and an IR sensitive phototransistor It can output digital signal to Ard
23. iteServolMicroseconds Function prototype void writeServo1Microseconds int value Writes value in microseconds us to 1 controlling Behavior description the shaft accordingly Input parameter value int The value of the parameter in microseconds Return parameter None o 3 4 10 writeServo2Microseconds function Table 34 describes the writeServo2Microseconds function Table 34 writeServo2Microseconds function writeServo2Microseconds Function prototype void writeServo2Microseconds int value Writes value in microseconds us to Servo2 controlling Behavior description the shaft accordingly Input parameter value int The value of the parameter in microseconds Return parameter None o 3 4 11 readServo1 function Table 35 describes the readServo1 function Table 35 readServo1 function Function prototype int readServo1 Behavior description Read the current angle of 5 1 Input parameter The angle of Servo1 from 0 to 180 degrees www makeblock cc 26 3 4 12 readServo2 function Table 36 describes the readServo2 function Table 36 readServo2 function Function prototype int readServo2 Behavior description Read the current angle of Servo2 The angle of Servo2 from 0 to 180 degrees 3 4 13 readServoiMicroseconds function Table 37 describes the readServo1Microseconds function Table 37 readServoiMicroseconds function
24. le with Makeblock beams Compact size 2 4cmx4 8cm LED indicator PWR Red LED Power indicator SERVO 1 Blue LED PWM indicator for Servo1 SERVO 2 Blue LED PWM indicator for Servo2 1 5 2 Usage As the Red tag illustrated the Me Servo Driver can be connected to the port 1 or 2 of the Me Base Shield by an telephone wire Connect one or two servo motors to the 3pin headers 1 5 3 Power supply When connected the Me Servo Driver can be powered by the 9 12V DC power from the port 1 or 2 of the Me Base Shield www makeblock cc 6 1 6 Bluetooth The Me Bluetooth is designed to connect with mobile phones by using the specific APP The Bluetooth module provides TTL level UART interface IE 1 ein NEP M tO Ra theta gt ES azo f 49 22 d 277 A 41 22 md si LI EN 134 CE 1 6 1 Features Power Supply 5VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield Bluetooth Protocol Bluetooth Specification v2 0 EDR Working Frequency 2 4 2 48GHz unlicensed ISM Band Transmission Distance 10 meters in free space Default Baud rate 9600 Supported baud rate 9600 19200 38400 57600 115200 230400 and 460800 LED indicator PWR Red LED Power indicator STA Blue LED Bluetooth status indicator Uniform Slow bl
25. nput parameter each of PORT_1 to PORT_6 and one signal pin outside for www makeblock cc 14 Table 6 setMePortinnersidePin function cotinued _ each of PORT 7 and PORT 8 outsidePinState int The variant outsidePinState can be Input parameter2 HIGH 1 or LOW O innersidePinState int The variant innersidePinState can be HIGH 1 or LOW O 0 00 3 1 5 readMePortOutsidePin function Input parameter3 Table7 describes the readMePortOutsidePin function Table 7 readMePortOutsidePin function Function name readMePortOutsidePin Function prototype void readMePortOutsidePin int port Behavior description Read the outside pin state of Me Port Input parameter port int The port can be PORT 1 to PORT 8 The returned value can be HIGH 1 or LOW 0 3 1 6 readMePortlnnersidePin function Table 8 describes the readMePortlnnersidePin function Table 8 readMePortinnersidePin function 3 1 7 readMePort function Table 9 describes the readMePort function Table 9 readMePort function Function prototype void readMePort int port int outsidePinState NULL int www makeblock cc 15 Table 9 readMePort function cotinued 22272 innersidePinState NULL Behavior description Read the pins state of Me Port port int There are two signal pins outside and inner side Input parameter for each of PORT_1 to PORT_6 and one signal pin outs
26. om its pin Return parameter 3 4 5 detachServo2 function Table 29 describes the detachServo2 function Table 29 detachServo2 function Function name detachServo2 Function prototype void detachServo2 Behavior description Detach Servo2 variable from its pin Return parameter 3 4 6 detachAll function Table 30 describes the detachAll function Table 30 detachAll function one Return parameter 3 4 7 writeServo1 function Table 31 describes the writeServo1 function Table 31 writeServo1 function Function name Function prototype void writeServo1 int value 2 Writes a value in degrees angle from 0 10180 to 5 1 Behavior description controlling the shaft accordingly value int The angle value to write to 1 from 0 to 180 Return parameter None ___ www makeblock cc 25 Input parameter 3 4 8 writeServo2 function Table 32 describes the writeServo2 function Table 32 writeServo2 function Function prototype void writeServo2 int value Writes value in degrees angle from 0 10180 to 5 1 Behavior description controlling the shaft accordingly value int The angle value to write to Servo2 from 0 to 180 Return None 3 4 9 writeServo1Microseconds function Input parameter Table 33 describes the writeServo1Microseconds function Table 33 writeServo1Microseconds function wr
27. on of each Electronic Module Library BaseShield define main interfaces used in Me BaseShield library Me BaseShieldMotorDriver for controlling Me BaseShield onboard motor driver Me MotorDriver for controlling motors Me ServoDriver for controlling servo motors Me Bluetooth for connecting with the mobile phone or other Bluetooth devices using the Me Bluetooth module Me InfraredReceiver for receiving the command from the infrared remote control Me LineFinder for the line following robotics Me UltrasonicSensor for distance measurement using Me UltrasonicSensor module www makeblock cc 12 3 Module Library Tutorial 3 1 Me_BaseShield Library functions The Me BaseShield Library defines the use of main interfaces Table 2 lists the BaseShield Library functions Class Me BaseShield No parameters needed when instantiation an object Table2 Me_BaseShield Library functions Function name Description BaseShield Instantiation an object Initialize the onboard motor driver and the begin PORT 1 to PORT 8 setMePortOutsidePin Set the state for the outside pin of Me Port setMePortlnnersidePin Set the state for the inner side pin of Me Port Set the state for the pins of Me Port Read the outside pin state of Me Port Read the inner side pin state of Me Port Read the pins state of Me Port Read the outside analog pin value of Me Port rea
28. ontrolling servo motors of Me_ServoDriver module Class Me_ServoDriver Users can specify PORT_1 or PORT_2 when instantiation an object Table 24 lists the Me_MotorDriver Library main member function Table 24 Me_MotorDriver Library functions Function name Description Initialize the state of connected and unconnected ports Servos_begin of Base Shield If you want to control both 5 1 and Servo2 you should use this function to initialize Initialize the state of connected and unconnected ports 1 begin of Base Shield If you just want to control 1 you should use this function to initialize Initialize the state of connected and unconnected ports Servo2_begin of Base Shield If you just want to control Servo2 you should use this function to initialize Detach 1 variable from its If you want to detachServo1 attach it again use 5 1 begin function Detach Servo2 variable from its pin If you want to detachServo2 attach it again use Servo2_begin function Detach Servo1 and Servo2 If you want to attach both detachAll Servol and Servo2 again use Servos_begin function Writes a value in degrees angle from to180 to writeServo1 1 controlling the shaft accordingly Writes a value in degrees angle from to180 to writeServo2 Servo2 controlling the shaft accordingly Writes a value in microseconds us to Servol writeServolMicro
29. ry appear in the menu in the Arduino IDE If you want to know more details about how to add a library visit following webpage htto www arduino cc en Hacking Libraries 2 2 1 Library folder Me Electronic Module Library folder contains eight different Electronic Modules Libraries folders and a MakeBlock_Demo folder Each electronic module library folder contains library header files class files and an example folder You should refer to www makeblock cc 11 these classes and learn from them If you need to add advanced features to Me Electronic Module Library this is where you will have to add them For normal use you shouldn t have to edit files in this library The example folder contains various example programs Use these programs as a reference or a starting point for your own programs Feel free to modify them to suit your needs We also have several demos for MakeBlock Kits here MakeBlock Demo folder You can use it as Electronic Modules quick start with your MakeBlock Kits Figure 1 Me Electronic Module Library folder structure El My Documents 5 Arduino libraries 1 MakeBlock Demo LineFinderRobot 1 RemoteControlDozer RemoteControlRobot 12 UltrasonicRangerTank Me BaseShield examples 1 BaseShieldMotorDriver Me Bluetooth 2 Me_InfraredReceiver 1 Me LineFinder 1 Me_MotorDriver 1 ServoDriver 1 Me UltrasonicSensor 2 2 2 Descripti
30. seconds controlling the shaft accordingly Writes a value in microseconds us to Servo2 writeServo2Microseconds l controlling the shaft accordingly www makeblock cc 23 Table 24 Me_MotorDriver Library functions continued servolAttached Check whether the 1 variable is attached to a pin servo2Attached Check whether the Servo2 variable is attached to a pin 3 4 1 Servos begin function Table 25 describes the Servos begin function Table 25 Servos begin function Function prototype void Servos begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 4 2 5 1 begin function Table 26 describes the Servo1_begin function Table 26 5 1 function Function prototype void Servo1 begin Initialize the state of connected and unconnected ports of Behavior description Base Shield 3 4 3 Servo2_begin function Table 27 describes the Servo2 begin function Table 27 5 2 begin function Function prototype void Servo2 begin a Initialize the state of connected and unconnected ports of Behavior description Base Shield www makeblock cc 24 3 4 4 detachServo1 function Table 28 describes the detachServo1 function Table 28 detachServo1 function Function name detachServo1 Function prototype void detachServo1 Behavior description Detach Servo1 variable fr
31. the Arduino Programming environment software for your operating system http arduino cc en Main Software Follow the instructions at that webpage to install it on your computer 2 2 Electronic Module Programming Library Me Electronic Module Library provides several features of different electronic modules which are accessible through C C NXShield library If you have not already visit following webpage and download latest library example programs and utilities from following location http www makeblock cc download Follow the instructions at that webpage to download the zip file on your computer The Me Electronic Module Library is supplied in one single zip file The extraction of the zip file generates one folder Me Lib 1 0 Open the Me ElectronicModules folder there are eight Electronic Modules Libraries folder and a MakeBlock Demo folder Before first programming we have to make a copy of these Electronic Modules Libraries folders to Arduino default library path The default path is usually in C Users user name Documents Arduino libraries on Windows7 Documents Arduino libraries on Mac Figure 1 shows the Electronic Modules Libraries folders structure after copy them to Arduino default library path After doing the copy open the Arduino IDE if you have already open the Arduino IDE you have to restart it and click File gt Sketchbook gt libraries you will see Me Electronic Module Libra
32. uino so the robot can reliably follow a black line on a white background or vice versa 1 8 1 Features 5VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield Detecting range 1 2cm LED indicator PWR Red LED Power indicator SENSOR1 Blue LED Sensor1 Status indicator Lighten shows black line detected by Sensor1 SENSOR2 Blue LED Sensor2 status indicator Lighten shows black line detected by Sensor2 1 8 2 Usage As the Blue tag illustrated the Me Line Finder be connected to the port 3 4 5 or 6 of the Me Base Shield by a telephone wire www makeblock cc 9 1 9 UltraSonic Sensor The Me UltraSonic Sensor module is designed for distance measurement or obstacle avoidance of the robotics 1 9 1 Features 5VDC power supply 4 Pin RJ10 interface and 2 54mm breakout pins Compatible with Me Base Shield Detecting range 3cm 4m best in 30 degree angle LED indicator D1 Red LED Power indicator 1 9 2 Usage As the Yellow tag illustrated the Me UltraSonic Sensor can be connected to the port 3 4 5 6 7 or 8 of the Me Base Shield by a telephone wire www makeblock cc 10 2 Me Electronic Module Library Introduction 2 1 Arduino Programming Environment Meduino uses Arduino Software for programming If you have not already visit following webpage and download
Download Pdf Manuals
Related Search
Related Contents
[ 富士ドライケム IMMUNO AU カートリッジ v Gamme HYGIELAND - Hygiena Boutique Versión PDF Vornado Flippi V Use and Care Manual Tecumseh AE4425Z-AA1AGC Technical Data Sheet Craftsman 40-inch Service Parts Copyright © All rights reserved.
Failed to retrieve file