Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 frequenz änderung mit c-control micro Kategorie: Programmierung Basic (von ghosti - 7.08.2005 16:17)
ghosti nutzt:  Micro
hallo ihr.

habe ein kleines projekt als völliger anfänger vor augen.
aus platzgründen würde ich gerne die c-control micro verwenden.
das folgende problem will ich lösen:
frequenz eingang 0-100Hz dieses signal soll im bereich von 83-116% geändert werden zwecks tachosignal änderung.
ich habe da auch schon eine kleine basic programmierung gemacht, allerdings weiß ich nicht ob und wie weit das funktioniert. würde da gerne mal euren rat hören. evtl auch verbesserungen.
dazu kommt allerdings noch das problem, das der micro keine frequenz und den beep ausgang gleichzeitig verarbeiten kann. gibt es da evtl eine andere möglichkeit der frequenz ausgabe???
das frequenz signal ist 5v und rechteckig. ist aber denke ich mal nicht hundertprozentig wichtig.

würde mich über ein paar nette mich weiterbringende antworten freuen.
gruß

define FREQPORT port[4]'messeingang der frequenz
define out port[1]'frequenz ausgang
define voltin ad[2]'eingang des potis

define poti byte 'multiplikator
define x byte 'frequenz eingang
define freqout byte 'frequenz ausgang

FREQ=50 'einstellen der mess-torzeit auf 1sec
x = FREQ

#verhaeltnis 'auswertung des potis von -17 bis +16 prozent
if voltin >0 then poti=83
if voltin >8 then poti=84
if voltin >16 then poti=85
if voltin >24 then poti=86
if voltin >32 then poti=87
if voltin >40 then poti=89
if voltin >48 then poti=90
if voltin >56 then poti=91
if voltin >64 then poti=92
if voltin >72 then Poti=93
if voltin >80 then poti=94
if voltin >88 then poti=95
if voltin >96 then poti=96
if voltin >104 then poti=97
if voltin >112 then poti=98
if voltin >120 then poti=99
if voltin >128 then poti=100
if voltin >134 then poti=101
if voltin >142 then poti=102
if voltin >150 then poti=103
if voltin >158 then poti=104
if voltin >164 then poti=105
if voltin >172 then poti=106
if voltin >180 then poti=107
if voltin >188 then poti=108
if voltin >196 then poti=109
if voltin >204 then poti=110
if voltin >212 then poti=111
if voltin >220 then poti=112
if voltin >228 then poti=113
if voltin >234 then poti=114
if voltin >242 then poti=115
if voltin >250 then poti=116

#pruefen 'pruefen ob eine Frequenz eingeht
if x=0 then goto pruefen else goto rechner

#rechner 'berechnung der neuen Frequenz
freqout=(x*poti+50)/100

#beep 'ausgabe der neuen Frequenz
beep 25000/freqout,0,out

end



 Antwort schreiben

Bisherige Antworten:

Re: frequenz änderung mit c-control micro (von Achim - 7.08.2005 20:09)
    Re: frequenz änderung mit c-control micro (von ghosti - 10.08.2005 14:49)