Вы находитесь на странице: 1из 2

Experiment no.

_____
Testing Big Ronn: CdS Photoresistors and DMC
Objectives
1. To become familiar with CdS Photoresistors and DMC
2. To become familiar with PICBASIC Pro as used in programming PIC
Parts and Instruments
(1) PC
(2) Microcode Studio plus
(3) Big Ronn
Procedure
1. Identify the port configuration of the following items as listed in Table 1.
CdS Photoresistor Left
CdS Photoresistor Right
DMC (dual motor controller)

2. Test the program to measure the resistance of the CdS on left side. Cover the
photoresistor with your palm and see the value of resistance as display by LCD.
Remove your palm and record again the resistance value. Note: To avoid
damaging the on-off (start) switch, turn on-off the power supply and not on the
switch on the robot itself, unless otherwise you are using embedded batteries
R(CdS Left),covered = _____________
R(CdcS Left), uncovered = __________
Program Sample 1:
Define LOADER_USED 1
v1 var byte
v2 var byte
symbol PRL = portc.5
symbol PRR = portd.3
pause 500

'wait for LCD to start up

main:
pot PRL,255,v1
pot PRR,255,v2
lcdout $FE,1
'clear LCD screen
lcdout "PR1 = " ' display PR1 value
lcdout #v1
pause 500
'wait 0.5 s
lcdout $FE, $C0
lcdout "PR2 = "
LCDout #v2

'starts writing at the second line

lcdout $FE, $0E


pause 500
goto main

3. Turn off the ceiling light (fluorescent light), and record the minimum value of
each CdS. Turn on the light, and with addition of flash light cast on each CdS,
measure the maximum resistance values.
Minimum values:
Maximum values:
R (left) = ________
R(left) = ________
R (right) = _______
R(right) = _______
4. Test the program of Sample 2. Instead of using servomotors, we are using the
DMC (Dual Motor Controller). The pin configuration of the DMC is given below.
Turn on the MCU (microcontroller unit) and the DMC. Be careful when you test
the program; Hold on the robot on the side since it may run wild.

QUESTIONS TO PONDER
1. Why do we need POT command at the start of the program on Program Sample
no.1?
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

Вам также может понравиться