My second line follower robot ( Dörtteker (fourwheel ))

Posted on 18/02/2009 by emrahse
Modified on: 13/09/2018
Project
Press to mark as completed
Introduction
This is an automatic import from our previous community platform. Some things can look imperfect.

If you are the original author, please access your User Control Panel and update it.

this project is continue. ... *MotorsI give motors by Fırat DEDE's website. Japan Autotrol 15:1 12V 746 Rpm http://www.robotus.net/motor/motor.asp motors are 10 mA *batteryI give Battery by türkkuşu of Türk Hava Kurumu.(bataryalar/li-po) http://modelucak.thk.org.tr/satis1/satis.php battry is lityum polimer 7.4 volt 1000 mA. I will ally to battery and total 14.8 volt *SensorsSensor is cny70. 4 front 4 back   *Program (proton-basic) Device = 16F876A XTAL = 20 ALL_DIGITAL = true TRISA=255 TRISB=255 ...


My second line follower robot ( Dörtteker (fourwheel ))

this project is continue.


.
..

*Motors

I give motors by Fırat DEDE's website. Japan Autotrol 15:1 12V 746 Rpm

http://www.robotus.net/motor/motor.asp

motors are 10 mA

*battery

I give Battery by türkkuşu of Türk Hava Kurumu.(bataryalar/li-po)

http://modelucak.thk.org.tr/satis1/satis.php

battry is lityum polimer 7.4 volt 1000 mA. I will ally to battery and total 14.8 volt

*Sensors

Sensor is cny70. 4 front 4 back

 

*Program (proton-basic)

Device = 16F876A

XTAL = 20

ALL_DIGITAL = true

TRISA=255

TRISB=255

TRISC=0

Declare CCP1_PIN PORTC.1

Declare CCP2_PIN PORTC.2

Dim HATA As Byte

Dim YON As Byte

Dim SAGPWM As DWord

 Dim SOLPWM As DWord

YON=1

'SAĞ [B5] [B2] [B0] [B1] [B3] [B6] SOL

'SOLPWM ----> SAĞ

'SAGPWM ----> SOL

BASLA:

'black to white (siyah-beyaz)

If PORTB.7=1 And PORTB.2=1 And PORTB.0=0 And PORTB.1=0 And PORTB.3=1 And PORTB.6=1 Then GoSub DUZ

If PORTB.7=1 And PORTB.2=1 And PORTB.0=0 And PORTB.1=1 And PORTB.3=1 And PORTB.6=1 Then GoSub SAG1If PORTB.7=1 And PORTB.2=0 And PORTB.0=0 And PORTB.1=1 And PORTB.3=1 And PORTB.6=1 Then GoSub SAG2

If PORTB.7=1 And PORTB.2=0 And PORTB.0=1 And PORTB.1=1 And PORTB.3=1 And PORTB.6=1 Then GoSub SAG3

If PORTB.7=0 And PORTB.2=1 And PORTB.0=1 And PORTB.1=1 And PORTB.3=1 And PORTB.6=1 Then GoSub SAG4

If PORTB.7=1 And PORTB.2=1 And PORTB.0=1 And PORTB.1=0 And PORTB.3=1 And PORTB.6=1 Then GoSub SOL1

If PORTB.7=1 And PORTB.2=1 And PORTB.0=1 And PORTB.1=0 And PORTB.3=0 And PORTB.6=1 Then GoSub SOL2

If PORTB.7=1 And PORTB.2=1 And PORTB.0=1 And PORTB.1=1 And PORTB.3=0 And PORTB.6=1 Then GoSub SOL3

If P
ORTB.7=1 And PORTB.2=1 And PORTB.0=1 And PORTB.1=1 And PORTB.3=1 And PORTB.6=0 Then GoSub SOL4

'white to black (beyaz-siyah)

If
PORTB.7=0 And PORTB.2=0 And PORTB.0=1 And PORTB.1=1 And PORTB.3=0 And PORTB.6=0 Then GoSub DUZ

If PORTB.7=0 And PORTB.2=0 And PORTB.0=1 And PORTB.1=0 And PORTB.3=0 And PORTB.6=0 Then GoSub SAG1

If
PORTB.7=0 And PORTB.2=1 And PORTB.0=1 And PORTB.1=0 And PORTB.3=0 And PORTB.6=0 Then GoSub SAG2

If PORTB.7=0 And PORTB.2=1 And PORTB.0=0 And PORTB.1=0 And PORTB.3=0 And PORTB.6=0 Then GoSub SAG3

If
PORTB.7=1 And PORTB.2=0 And PORTB.0=0 And PORTB.1=0 And PORTB.3=0 And PORTB.6=0 Then GoSub SAG4

If PORTB.7=0 And PORTB.2=0 And PORTB.0=0 And PORTB.1=1 And PORTB.3=0 And PORTB.6=0 Then GoSub SOL1

If PORTB.7=0 And PORTB.2=0 And PORTB.0=0 And PORTB.1=1 And PORTB.3=1 And PORTB.6=0 Then GoSub SOL2

If PORTB.7=0 And PORTB.2=0 And PORTB.0=0 And PORTB.1=0 And PORTB.3=1 And PORTB.6=0 Then GoSub SOL3

If PORTB.7=0 And PORTB.2=0 And PORTB.0=0 And PORTB.1=0 And PORTB.3=0 And PORTB.6=1 Then GoSub SOL4

' IF YON=2 THEN GOSUB bekle

' IF PORTB.7=0 AND PORTB.2=0 AND PORTB.0=0 AND PORTB.1=0 AND PORTB.3=0 AND PORTB.6=0 THEN HPWM 2,255,20000 : HPWM 1,255,20000 :DELAYMS 350 ' GOSUB say

' IF YON=4 THEN GOSUB bekle

' IF YON=4 THEN GOSUB dur

HPWM 2,SAGPWM,20000

HPWM 1,SOLPWM,20000

GoTo BASLA

bekle:

DelayMS 10

SAGPWM=195

SOLPWM=200

Return

say:

YON=YON + 1

DelayMS 10

Return

dur:

SAGPWM=0

SOLPWM=0

HPWM 2,SAGPWM,20000

HPWM 1,SOLPWM,20000

GoTo dur

DUZ:

SAGPWM=255

SOLPWM=255

Return

SOL1:

SAGPWM=254

SOLPWM=220

' YON=1

Return

SOL2:

SAGPWM=254

SOLPWM=160

' YON=1

Return

SOL3:

SAGPWM=254

SOLPWM=100

' YON=1

Return

SOL4:

SAGPWM=254

SOLPWM=0

Return

SAG4:

SAGPWM=0

SOLPWM=254

Return

SAG3:

SAGPWM=100

SOLPWM=254

' YON=2

Return

SAG2:

SAGPWM=160

SOLPWM=254

' YON=2

Return

SAG1:

SAGPWM=220

SOLPWM=254

' YON=2

Return

  • CPU: 16f876A
  • Power source: 2x 7.4 Volt 1000mA lityum polimer
  • Programming language: c or basic
  • Sensors / input devices: CNY70
Flag this post

Thanks for helping to keep our community civil!


Notify staff privately
It's Spam
This post is an advertisement, or vandalism. It is not useful or relevant to the current topic.

You flagged this as spam. Undo flag.Flag Post