Embedded Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsComputer HardwareEmbedded Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 18th, 2011, 10:04 PM
kingbp kingbp is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2011
Posts: 1 kingbp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 34 sec
Reputation Power: 0
Cool Dijkstra algorithm Pbasic

Hello I'm doing a project with a robot caled the boe-bot. My project deals with the boe-bot going through a maze twice: the first time it goes through every single path, even the dead ends, and on the second run it has the entire maze stored in memory so it takes the shortest path to the finish line avoiding all dead ends.

Here is my code so far in pbasic. It goes through the entire maze but doesn't memorize the paths taken. Can you guys add an algorithm in pbasic for memorizing paths taken to my code thanks.

' {$STAMP BS2}
' {$PBASIC 2.5}



DEBUG "Program Running!"
counter VAR Word
FREQOUT 4, 2000, 3000 ' Signal program start/reset.
FOR counter = 1 TO 41
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
DO
SELECT INL ' Select line follower states
CASE %11000000, %11100000 ' Pivot right
PULSOUT 13, 650
PULSOUT 12, 650
CASE %01100000, %01110000 ' Curve right
PULSOUT 13, 700
PULSOUT 12, 650
CASE %00110000 ' Slight right
PULSOUT 13, 750
PULSOUT 12, 650
CASE %00111000 ' Adjust right
PULSOUT 13, 800
PULSOUT 12, 650
CASE %11111111 ' T Intersection
PULSOUT 13, 750
PULSOUT 12, 650
CASE %00011000 ' Straight
PULSOUT 13, 850
PULSOUT 12, 650
CASE %11111111 ' T Intersection Right Turn
PULSOUT 13, 750
PULSOUT 12, 650
CASE %00011100 ' Adjust left
PULSOUT 13, 850
PULSOUT 12, 700
CASE %00001100 ' Slight left
PULSOUT 13, 850
PULSOUT 12, 750
CASE %00000110, %00001110 ' Curve left
PULSOUT 13, 850
PULSOUT 12, 800
CASE %00000011, %00000111 ' Pivot left
PULSOUT 13, 850
PULSOUT 12, 850
CASE %00000000 'U-Turn
PULSOUT 13, 850
PULSOUT 12, 850
ENDSELECT
LOOP

Reply With Quote
Reply

Viewing: Dev Shed ForumsComputer HardwareEmbedded Programming > Dijkstra algorithm Pbasic

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap