BOB-Jízda rovně: Porovnání verzí

Z MediaWiki SPŠ a VOŠ Písek
Skočit na navigaci Skočit na vyhledávání
Bez shrnutí editace
Bez shrnutí editace
 
(Nejsou zobrazeny 4 mezilehlé verze od stejného uživatele.)
Řádek 1: Řádek 1:
'''Program pro jízdu rovně neomezeně dlouho.'''<br>
=='''Program pro jízdu rovně neomezeně dlouho.'''==


' {$STAMP BS2}
[[Soubor:BOB-rovne-001.jpg]]
' {$PBASIC 2.5}
counter  VAR  Word
FREQOUT 4, 2000, 3000


DO
[[Media:BOB-rovne-001.bs2|download]]
    PULSOUT 13,850  ; linka 13, délka impulsu 850 x 2 us = 1,7 ms - otáčí se jedním směrem
    PULSOUT 12,650  ; linka 12, délka impulsu 650 x 2 us = 1,3 ms - otáčí se opačným směrem
    PAUSE 20
LOOP


=='''Program pro jízdu rovně po dobu t.'''==


[[Soubor:BOB-poradrovne.mp4]]<br>
[[Soubor:BOB-rovne-002.jpg]]


'''Program pro jízdu rovně po dobu t.'''
[[Media:BOB-rovne-002.bs2|download]]


<source lang="qbasic">
  ' {$STAMP BS2}
  ' {$STAMP BS2}
  ' {$PBASIC 2.5}
  ' {$PBASIC 2.5}
 
  counter    VAR    Word
  counter    VAR    Word
  FREQOUT 4, 2000, 3000
  FREQOUT 4, 2000, 3000
 
  FOR counter = 1 TO 122
  FOR counter = 1 TO 122
     PULSOUT 13,850
     PULSOUT 13,850
     PULSOUT 12,650
     PULSOUT 12,650
     PAUSE 20
     PAUSE 20
  NEXT
  NEXT
</source>


Chapter 2


[[Soubor:BOB-urcitycas.mp4]]
==Project #2==
(located near the end of the chapter)


* Robotics with the Boe-Bot - Chapter2Project2.bs2
* This takes the servos through three seconds of each of the four different
* combinations of rotation. First, both servos should rotate CCW,
* then they should both rotate CW. Then, the P12 servo should rotate CW as the P13
* servo rotates CCW, and finally, the P12 servo should rotate CCW while the P13
* servo rotates CW


původně fungující syntaxe na wiki:
<source lang="qbasic">
<source lang="qbasic">
  ' {$STAMP BS2}
  ' {$STAMP BS2}
  ' {$PBASIC 2.5}
  ' {$PBASIC 2.5}


  counter   VAR   Word
  counter VAR Byte
  FREQOUT 4, 2000, 3000
 
DEBUG "Program Running!"
 
  FOR counter = 1 TO 120 ' 120 = 3s/((1.7 + 1.7 + 20 + 1.6)0.001s)
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 20
NEXT
 
FOR counter = 1 TO 124 ' 124 = 3s/((1.3 + 1.3 + 20 + 1.6)0.001s)
PULSOUT 13, 650
PULSOUT 12, 650
PAUSE 20
NEXT


  FOR counter = 1 TO 122
  FOR counter = 1 TO 122 ' 122 = 3s/((1.7 + 1.3 + 20 + 1.6)0.001s)
    PULSOUT 13,850
PULSOUT 13, 850
    PULSOUT 12,650
PULSOUT 12, 650
    PAUSE 20
PAUSE 20
NEXT


FOR counter = 1 TO 122 ' 122 = 3s/((1.3 + 1.7 + 20 + 1.6)0.001s)
PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
  NEXT
  NEXT
END
</source>
</source>


[http://www.aaronklapheck.com/Boe-Bot_code.html source code]
[http://www.aaronklapheck.com/Boe-Bot_code.html source code]

Aktuální verze z 27. 4. 2011, 17:55

Program pro jízdu rovně neomezeně dlouho.

download

Program pro jízdu rovně po dobu t.

download

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

 counter    VAR    Word
 FREQOUT 4, 2000, 3000

 FOR counter = 1 TO 122
    PULSOUT 13,850
    PULSOUT 12,650
    PAUSE 20

 NEXT

Chapter 2


Project #2

(located near the end of the chapter)

  • Robotics with the Boe-Bot - Chapter2Project2.bs2
  • This takes the servos through three seconds of each of the four different
  • combinations of rotation. First, both servos should rotate CCW,
  • then they should both rotate CW. Then, the P12 servo should rotate CW as the P13
  • servo rotates CCW, and finally, the P12 servo should rotate CCW while the P13
  • servo rotates CW
 ' {$STAMP BS2}
 ' {$PBASIC 2.5}

 counter VAR Byte

 DEBUG "Program Running!"

 FOR counter = 1 TO 120 ' 120 = 3s/((1.7 + 1.7 + 20 + 1.6)0.001s)
 PULSOUT 13, 850
 PULSOUT 12, 850
 PAUSE 20
 NEXT

 FOR counter = 1 TO 124 ' 124 = 3s/((1.3 + 1.3 + 20 + 1.6)0.001s)
 PULSOUT 13, 650
 PULSOUT 12, 650
 PAUSE 20
 NEXT

 FOR counter = 1 TO 122 ' 122 = 3s/((1.7 + 1.3 + 20 + 1.6)0.001s)
 PULSOUT 13, 850
 PULSOUT 12, 650
 PAUSE 20
 NEXT

 FOR counter = 1 TO 122 ' 122 = 3s/((1.3 + 1.7 + 20 + 1.6)0.001s)
 PULSOUT 13, 650
 PULSOUT 12, 850
 PAUSE 20
 NEXT

 END

source code