Download presentation
Presentation is loading. Please wait.
Published byHilda Flowers Modified over 9 years ago
1
Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors: 0-100
2
Calibrate Me! (Put on my glasses) Black 36% Place me on BLACK. I’ll tell you what I see when NOT calibrated (without glasses). Hit the “down” button to teach me what black/dark looks like to you.
3
Calibrate Me! (Put on my glasses) Place me on WHITE. I’ll tell you what I see when NOT calibrated (without glasses). Hit the “up” button to teach me what white/light looks like to you. White 48%
4
Calibrate Me! (Put on my glasses) Now move me around to test if I’m well calibrated. Black should be close to zero (0). 6%
5
Calibrate Me! (Put on my glasses) Now move me around to test if I’m well calibrated. White should be close to 100. 96%
6
Go to Line, then Stop 100 70 50 0
7
Go to Line, then Stop CODE
8
6 State Line Follower 50 What should the bot do? Drive Straight Motor B: 50 Motor C: 50
9
6 State Line Follower 0 What should the bot do? BIG Pivot B Motor Motor B: 50 Motor C: 20
10
6 State Line Follower 20 What should the bot do? Pivot B Motor Motor B: 50 Motor C: 30
11
6 State Line Follower 40 What should the bot do? SLIGHT Pivot B Motor Motor B: 50 Motor C: 40
12
6 State Line Follower 60 What should the bot do? SLIGHT Pivot C Motor Motor B: 40 Motor C: 50
13
6 State Line Follower 80 What should the bot do? Pivot C Motor Motor B: 30 Motor C: 50
14
6 State Line Follower 100 What should the bot do? BIG Pivot C Motor Motor B: 20 Motor C: 50
15
Why is it called a 6-state line follower? We looked situations that need to be corrected, in chunks of twenty. The bot sees colors as numbers from 0 – 100, or a range of 100. 100 ÷ 20 = 5 BUT we need to count both the 0 and 100 chunks. SO….
16
Why is it called a 6-state line follower?
17
Which block is best? Light Sensor block: Takes a reading of what the bot currently sees with the light sensor Doesn’t actually do anything with that information You must tell it what to do with the info using DATA WIRES Wait block: Waits to move on to the next command (block) until a condition is met
18
Which block is best? Light Sensor block: Used for line following Wait block: Used for stopping at lines
19
Writing the CODE for a 6- state line follower
20
Adding the Switch (choices)
21
Writing the CODE: The SWITCH Conditions
22
Writing the CODE: The SWITCH Speeds Tab 0 0 ÷ 20 = 0 B: 50 sp C: 20 sp Tab 1 20 ÷ 20 = 1 B: 50 sp C: 30 sp Tab 2 40 ÷ 20 = 2 B: 50 sp C: 40 sp
23
Writing the CODE: The SWITCH Speeds Tab 5 100 ÷ 20 = 5 B: 20 sp C: 50 sp Tab 4 80 ÷ 20 = 4 B: 30 sp C: 50 sp Tab 3 60 ÷ 20 = 3 B: 40 sp C: 50 sp
24
Writing the CODE: The SWITCH Speeds
25
6-State Line Follower: The CODE Control how long you follow the line
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.