- LiTime Speicher und Akkus         
Ergebnis 1 bis 2 von 2

Thema: RP6 - Bibliotheken

  1. #1
    Benutzer Stammmitglied
    Registriert seit
    10.10.2009
    Beiträge
    66

    RP6 - Bibliotheken

    Anzeige

    Praxistest und DIY Projekte
    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

  2. #2
    Moderator Robotik Visionär Avatar von radbruch
    Registriert seit
    27.12.2006
    Ort
    Stuttgart
    Alter
    61
    Beiträge
    5.799
    Blog-Einträge
    8
    Hallo

    Auf der RP6-Homepage findest du unter "Dokumente" die Schaltpläne und die Datenblätter der verwendeten Bauteile. Unter "Software" findest du die aktuellen Libraries, den aktuellen RobotLoader und sehr gut dokumentierte Beispielprogramme 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:
    Code:
     $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/ze...=389966#389966

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

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

    Gruß

    mic
    Bild hier  
    Atmel’s products are not intended, authorized, or warranted for use
    as components in applications intended to support or sustain life!

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

LiFePO4 Speicher Test