Moin Moin,
hab mir ein RN-Control 1.4 gekauft und versuch nun mein erstes Projekt, was natürlich nicht auf anhieb funktioniert. Wenn man auf Taste1 drückt soll der Motor starten, allerdings tut sich beim Tastendruck gar nichts, woran kann das liegen?
Code:Declare Sub Motortest() Declare Function Tastenabfrage() As Byte $regfile = "m16def.dat" $crystal = 16000000 $baud = 9600 Config Pina.7 = Input Porta.7 = 1 Config Pinc.6 = Output Config Pinc.7 = Output Config Pind.4 = Output Config Adc = Single , Prescaler = Auto Dim Taste As Byte Function Tastenabfrage() As Byte Local Ws As Word Tastenabfrage = 0 Start Adc Ws = Getadc(7) If Ws < 1010 Then Select Case Ws Case 410 To 450 Tastenabfrage = 1 End Select End If End Function Do Taste = Tastenabfrage() If Taste <> 0 Then Select Case Taste Case 1 Call Motortest End Select End If Waitms 100 Loop End Sub Motortest() Portc.6 = 1 Portc.7 = 0 Portd.4 = 1 Pwm1a = 100 Pwm1b = 100 End Sub







Zitieren

Lesezeichen