Presentation is loading. Please wait.

Presentation is loading. Please wait.

Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors: 0-100.

Similar presentations


Presentation on theme: "Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors: 0-100."— Presentation transcript:

1 Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors: 0-100

2 Calibrate Me! (Put on my glasses) BC Black  36% Place me on black. I’ll tell you what I see when not calibrated (without glasses). Hit the orange “enter” button to teach me what black/dark looks like to you.

3 Calibrate Me! (Put on my glasses) BC Black  36% White  39% Place me on white. I’ll tell you what I see when not calibrated (without glasses). Hit the orange “enter” button to teach me what white/light looks like to you.

4 Calibrate Me! (Put on my glasses) BC Intensity  8% Now move me around to test if I’m well calibrated. Black should be close to zero (0).

5 Calibrate Me! (Put on my glasses) BC Intensity  98% Now move me around to test if I’m well calibrated. White should be close to 100.

6 Go to Line, then Stop BC 100 70

7 Go to Line, then Stop BC 70 50

8 Go to Line, then Stop BC 50 0

9 Go to Line, then Stop CODE

10 6 State Line Follower BC 50 What should the bot do? Drive Straight Motor B: 50 Motor C: 50

11 6 State Line Follower BC 0 What should the bot do? BIG Pivot B Motor Motor B: 50 Motor C: 20

12 6 State Line Follower BC 20 What should the bot do? Pivot B Motor Motor B: 50 Motor C: 30

13 6 State Line Follower BC 40 What should the bot do? SLIGHT Pivot B Motor Motor B: 50 Motor C: 40

14 6 State Line Follower BC 60 What should the bot do? SLIGHT Pivot C Motor Motor B: 40 Motor C: 50

15 6 State Line Follower BC 80 What should the bot do? Pivot C Motor Motor B: 30 Motor C: 50

16 6 State Line Follower BC 100 What should the bot do? BIG Pivot C Motor Motor B: 20 Motor C: 50

17 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….

18 Why is it called a 6-state line follower?

19 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

20 Which block is best? Light Sensor block: Used for line following Wait block: Used for stopping at lines

21 Writing the CODE for a 6-state line follower

22 Adding the Switch (choices) When you add block in here, it will “crowbar” open to reveal all 6 tabs.

23 Writing the CODE: The SWITCH Conditions Put 2 motor blocks in each of the 6 tabs.

24 Writing the CODE: The SWITCH Speeds 1 st Tab (0) 0 ÷ 20 = 0 B: 50 sp C: 20 sp 2 nd Tab (1) 20 ÷ 20 = 1 B: 50 sp C: 30 sp 3 rd Tab (2) 40 ÷ 20 = 2 B: 50 sp C: 40 sp

25 Writing the CODE: The SWITCH Speeds 6 th Tab (5) 100 ÷ 20 = 5 B: 20 sp C: 50 sp 5 th Tab (4) 80 ÷ 20 = 4 B: 30 sp C: 50 sp 4 th Tab (3) 60 ÷ 20 = 3 B: 40 sp C: 50 sp

26 Writing the CODE: The SWITCH Speeds

27 6-State Line Follower: The CODE So Far… Problem: This only makes a choice 1 time!

28 6-State Line Follower: The CODE So Far… Solution: Put it all inside a loop!


Download ppt "Human Vision Robot (Light Sensor) Vision White/Light: 100 Black/Dark: 0 Colors: 0-100."

Similar presentations


Ads by Google