PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : RP6 - Bibliotheken



sp33dy
13.11.2010, 10:52
Hallo,
habe seit ein paar Tagen den RP6. Mit Win-AVR habe ich das Problem, dass ich eigentlich nirgends irgendwelche Funktionen nachschauen kann. Gibt es keine Doku, wo welche Bauteile (Sensoren, Motoren etc) angeschlossen sind und mit welchem c-code diese ausgeführt werden? Auch für nachträgliche Sensoren ist dieses knowhow zwingend nötig.
Meine bisherige Hardware RN-Control ist ja genial beschrieben und mit konkreten Beispielen (Bascom-AVR) versehen.
Wäre sehr dankbar über konkrete Infos...
mfg
sp33dy

radbruch
13.11.2010, 11:18
Hallo

Auf der RP6-Homepage findest du unter "Dokumente (http://arexx.com/rp6/html/de/docs.htm)" die Schaltpläne und die Datenblätter der verwendeten Bauteile. Unter "Software (http://arexx.com/rp6/html/de/software.htm)" findest du die aktuellen Libraries, den aktuellen RobotLoader und sehr gut dokumentierte Beispielprogramme (http://arexx.com/rp6/downloads/RP6Examples_20080915.zip) für alle Funktionen des RP6.

Das ist aber alles in C, in Bascom gibt es wenig für den RP6. Hier ein RC5-Fernsteuer-Code mit den wichtigsten Funktionen. Leider weiß ich nicht mehr, wer das geschrieben hat oder ob das überhaupt funktioniert:

$regfile = "M32def.dat"
$crystal = 8000000
$hwstack = 32
$swstack = 32
$framesize = 64
$baud = 38400

Declare Sub Rp6_vorwaerts()
Declare Sub Rp6_rueckwaerts()
Declare Sub Rp6_stop()
Declare Sub Rp6_links()
Declare Sub Rp6_rechts()

Dim Tccr1a_set As Byte
Dim Tccr1b_set As Byte
Dim Wert As Byte
Dim Zaehler As Word
Dim Zaehler1 As Word
Dim Test As Byte

Dim Address As Byte , Command As Byte

Config Rc5 = Pinb.2

Config Pinc.2 = Output
Config Pinc.3 = Output
Config Pinb.4 = Output

On Int0 Int0_int
On Int1 Int1_int
On Int2 Int2_int

Enable Interrupts

Config Int0 = Falling
Config Int1 = Falling

Enable Int0
Enable Int1
Enable Int2

Tccr1a_set = 0
Tccr1b_set = 0

Reset Tccr1a_set .wgm10
Set Tccr1a_set .wgm11
Set Tccr1a_set .com1a1
Set Tccr1a_set .com1b1
Tccr1a = Tccr1a Or Tccr1a_set

Reset Tccr1b_set .wgm12
Set Tccr1b_set .wgm13
Set Tccr1b_set .cs10
Tccr1b = Tccr1b Or Tccr1b_set

Icr1h = 0
Icr1l = 210

Set Portb.4

Wert = 0

Wait 1

Do

Waitms 500


Loop

Reset Portb.4

End

Int0_int:
Disable Int0
Enable Interrupts
Zaehler = Zaehler + 1
Enable Int0
Return

Int1_int:
Disable Int1
Enable Interrupts
Zaehler1 = Zaehler1 + 1
Enable Int1
Return

Int2_int:
Disable Int2
Enable Interrupts
Getrc5(address , Command)
If Command = 1 Then
Call Rp6_vorwaerts()
End If
If Command = 2 Then
Call Rp6_rueckwaerts()
End If
If Command = 3 Then
Call Rp6_links()
End If
If Command = 4 Then
Call Rp6_rechts()
End If
If Command = 0 Then
Call Rp6_stop()
End If
Enable Int2
Return

Sub Rp6_vorwaerts()
Call Rp6_stop()

Reset Portc.2
Reset Portc.3

For Wert = 0 To 100
Waitms 20
Pwm1a = Wert - 3
Pwm1b = Wert
Next
End Sub

Sub Rp6_rueckwaerts()
Call Rp6_stop()

Set Portc.2
Set Portc.3

For Wert = 0 To 100
Waitms 20
Pwm1a = Wert - 3
Pwm1b = Wert
Next
End Sub

Sub Rp6_links()
Call Rp6_stop()

Set Portc.2
Reset Portc.3

For Wert = 0 To 60
Waitms 20
Pwm1a = Wert
Pwm1b = Wert
Next
End Sub

Sub Rp6_rechts()
Call Rp6_stop()

Reset Portc.2
Set Portc.3

For Wert = 0 To 60
Waitms 20
Pwm1a = Wert
Pwm1b = Wert
Next
End Sub

Sub Rp6_stop()

For Test = Wert To 0 Step -1
Pwm1b = Test
Pwm1a = Test
Waitms 10
Next

Wert = 0

End Sub

Meine eigenen Bascom-Versuche mit Nunchuk, LCD und Servos:
https://www.roboternetz.de/phpBB2/zeigebeitrag.php?p=389966#389966

http://www.arexx.com/forum/viewtopic.php?t=490

http://www.google.de/search?q=rp6+bascom

Gruß

mic