1.2k likes | 1.22k Views
MOTIVE /’ məʊtɪv /. Noun: reason for doing something Adjective: producing physical or mechanical motion. www.myduino.com No.7A (1st Floor) Jalan Badminton 13/29, Tadisma Business Park, 40100 Shah Alam, Selangor 03-55235321 / 013-2899151. SESSION OBJECTIVES. 1. 2. 3.
E N D
MOTIVE /’məʊtɪv/ Noun: reason for doing something Adjective: producing physical or mechanical motion www.myduino.com No.7A (1st Floor) Jalan Badminton 13/29, Tadisma Business Park, 40100 Shah Alam, Selangor 03-55235321 / 013-2899151
SESSION OBJECTIVES • 1 • 2 • 3
KNOWLEDGE & SKILLS REF: MDEC DIGITAL BADGE
SMART ROOM - THE BLOCK DIAGRAM THE BRAIN SENSOR 1 ACTUATOR 1 SENSOR 2 ACTUATOR 2 SENSOR 3 OUTPUT INPUT
THE BLOCK DIAGRAM THE BRAIN ROOM LIGHT LIGHTS TEMPERATURE SENSOR FAN MOTION SENSOR INPUT OUTPUT
WASHING MACHINE - THE BLOCK DIAGRAM THE BRAIN SENSOR 1 ACTUATOR 1 SENSOR 2 ACTUATOR 2 SENSOR 3 OUTPUT INPUT
Close Water Valve • FLOW CHART – WASHING MACHINE On Motor to Rinse Stop Motor Start Measure Weight of Water Rinsing Time Reach ? No Press Switch ? No Open Drain Valve Reach Desired Weight ? No Yes Yes All Water Drained? Rotate 3 times No Stop Motor Yes Close Water Valve Measure Weight Open Drain Valve Yes Close Drain Valve On Motor to Wash Calculate Amount of Water, Wash Time, Rinse Time, Spin Time All Water Drained? No Open Water Valve Washing Time Reach ? No Yes Reach Desired Weight ? Open Water Valve On Motor to Spin No Yes Yes
INPUTS INTERACTION OUTPUTS REAL WORLD PROGRAM YOUR INSTRUCTION • Microcontrollers are dedicated to one task and run one specific program • Examples of tasks could be: • Received from inputs via ports (read from external hardware) • Process the data, store in file registers, arithmetic operations (added, subtracted, logic gates), etc. • Control outputs (control hardware)
Flexible Programming • Graphical Scratch Based Programme (Drag & Drop) • Text Based Arduino Programming • Add on Possibilities • Available Digital I/O & Analog Input Header Pins • Future Proof • OLED Display • MP3 Player • Multiple Built-In Sensors • IR 4.0 Compatibility • WIFI Socket • XBEE & BLUETOOTH Socket • Two board operations • Upper board with main controller offers stand-alone flexibility for innovative projects • Lower board equipped with power management for efficient motor operation
BUILT-IN 16 MENU PROGRAMS • BLINK LED • RUNNING LIGHT • RGB • PUSH BUTTONS • MELODY • LDR • TEMPERATURE & HUMIDITY • ULTRASONIC • REAL TIME CLOCK • MP3 PLAYER • OBSTACLE ROBOT • ROBOT STEP • BLUETOOTH • LINE TRACKING • STOP WATCH • MOTOR SETUP • ASSESS THROUGH • 5-WAY JOYSTICK & OLED
PRE-LEARNING PREPARATION Please ensure that you have the following: PERSONAL COMPUTER Running Windows, Linux or MacOS with a USB port 1 MOTIVE ROBOT This guide uses the Motive Robot Platform 2 MBLOCK & ARDUINO SOFTWARE Referred to as an Integrated Developers Environment (IDE) 3
DOWNLOAD & INSTALL THE ARDUINO SOFTWARE REF: SIK GUIDE by SPARKFUN ELECTRONICS
FOLLOW THROUGH THE INSTALLATION PROCESS ACCORDINGLY AN ARDUINO SHORTCUT WILL BE ADDED ON YOUR DESKTOP REF: SIK GUIDE by SPARKFUN ELECTRONICS
MBLOCK INSTALLATION REF: MBLOCK GUIDE
ADDING EXTENSION FOR MOTIVE Extensions allow custom blocks for mBlock programming. Motive has its very own extension that enables the full control of its on-board features and robotic features. To use it, we have to first add the extension into mBlock. 1 Select and click on “Manage Extension”
Select and click on “Installed” 2 Select and click on “Add Extension” 3
Go to the folder that contains the zip extension file 4 Select and click on zip file 5
Select Motive_Robot Zip File 6 Select and click Open 7
Check to see Motive Extension successfully added by clicking “Robot” 8 Repeat steps 1 to 8 to add 2 more extension for OLED and DHT11 9
:SCRATCH BASED MBLOCK PROGRAMMING PROGRAMMING AREA Drag your script here to control MOTIVE SCRIPT List of instructions / code blocks available
STEP SELECT THE SCRIPT “ROBOTS” 1 STEP CODE BLOCKS FOR MOTIVE WILL APPEARS 2
AVAILABLE BLOCKS FOR MOTIVE LIGHT LED CONTROL Options available to control on board LED BUZZER CONTROL Options available to play melodies PUSH BUTTON CONTROL Options available to control on board switch READ SENSORS Options available to read ultrasonic & LDR WRITE TEXT TO SERIAL COMM
ADDITIONAL BLOCKS FOR OLED & TEMPERATURE/HUMIDITY SENSORS OLED DISPLAY CONTROL Commands to control onboard OLED TEMPERATURE & HUMIDITY Commands to read from DHT Sensor
PROJECT 1: BLINK LED THERE ARE 12 LEDS ON MOTIVE
SELECT & DRAG THE CODE BLOCK “MOTIVE CODING” TO THE PROGRAMMING AREA STEP 1 SELECT & DRAG THE CODE BLOCK “TURN LED” TO THE PROGRAMMING AREA. ATTACHED THE BLOCK WITH THE “MOTIVE CODING” STEP STEP 2 3 YOU CAN NOW CHOOSE WHICH LED TO CONTROL AND TO EITHER TURN IT ON OR OFF
SELECT THE SCRIPT “CONTROL” TO HAVE ACCESS TO THE CONTROL BLOCKS STEP 4 STEP 5 IN THE CONTROL BLOCKS, SELECT “WAIT 1 SECS”. DRAG AND SNAP ON UNDER THE “TURN LED” BLOCK LOOK AT THE CODING, LED 1 WILL TURN ON FOR 1 SEC
TO BLINK THE LED, AFTER WE TURN IT ON FOR 1 SECOND, WE WILL THEN TURN IT OFF FOR 1 SECOND. JUST COPY THE PREVIOUS BLOCK. PLACE THE MOUSE ON CODE BLOCK “TURN ON” AND RIGHT CLICK. A MENU WILL APPEAR AND CLICK DUPLICATE STEP 6 A DUPLICATE OF THE PREVIOUS CODE BLOCK WILL APPEAR. SNAP IT UNDER THE “WAIT 1 SECS” BLOCK STEP STEP 7 8 WE CAN SELECT TO TURN OFF LED 1
UPLOAD CODES TO MOTIVE STEP STEP CLICK ON THE BLOCK “MOTIVE CODING” AND THE ARDUINO TEXT MODE WILL APPEAR 9 10 GO TO BOARDS AND SELECT ARDUINO MEGA 2560
CLICK ON “CONNECT”, THEN “SERIAL PORT” AND CHOOSE THE COM# THAT MOTIVE IS CONNECTED TO. Note: Refer to the device manager STEP STEP 11 12 CLICK ON “UPLOAD TO ARDUINO” TO SENT THE PROGRAMME TO MOTIVE
UPLOAD SEQUENCE LED 1 WILL BLINK ONLY ONCE AFTER THE UPLOAD IS FINISH
LOOKING AT THE PROGRAMMING BLOCKS, LED 1 WILL TURN ON FOR 1 SECOND AND THEN TURN OFF FOR 1 SECOND. IT WILL ONLY BLINK ONCE TO MAKE IT BLINK CONTINOUSLY, WE MUST PUT OUR CODE INSIDE A FOREVER LOOP CLICK ON THE CONTROL SCRIPT AND SELECT “FOREVER” LOOP. DRAG THE BLOCK TO THE PROGRAMMING AREA. STEP STEP 14 13 DRAG THE CODES FOR BLINK INTO THE FOREVER LOOP. SNAP IT ALL BACK UNDER “MOTIVE CODING”
UPLOAD TO MOTIVE STEP STEP CLICK ON THE BLOCK “MOTIVE CODING” AND THE ARDUINO TEXT MODE WILL APPEAR 15 16 CLICK ON “UPLOAD TO ARDUINO” TO SENT THE PROGRAMME TO MOTIVE
PROJECT 1: BLINK LED - COMPLETED LED 1 WILL BLINK CONTINUOSLY AFTER THE UPLOAD IS FINISH