-
-
Yeti gerupft
Habe meinen YETI auseinander gebaut.
Die Elektronik läuft jetzt als Uhr.
Programm:
//# Programm Timer
// - Diplayanzeige
// - Stunden un Minuten
// Stand: 29.11.2007
// Update: 15.01.2008
// Kurt Pieper
#include "yeti.h" //load definitions and functions
#include "yetimove.c" //insert YETI’s servo functions
#include "display.c"
//================================================== ====================
// MAKE DISPLAY GO BLANC
//================================================== ====================
void vMakeDisplayGoBlanc(void){
//var
int i;
volatile unsigned char vucDspVal[NUMOF_DISPLAYS];
//handle all display segments
for(i=0;i<NUMOF_DISPLAYS;i++){
//fill segment code with blanc
vucDspVal[i]=18;
}
//send segment codes to display unit
ucShowFourDisplayValuesInDisplayUnit(&vucDspVal[0]);
}
void LED(void){
//var
vFrontLEDs(RIGHT); //activate YETI’s right eye LED
vWaitMilliseconds(500); //wait half a second
vFrontLEDs(OFF); //deactivate YETI’s right eye LED
vWaitMilliseconds(500); //wait half a second
}
void endlos(void)
{
vFrontLEDs(RIGHT); //activate YETI’s right eye LED
vFrontLEDs(LEFT); //activate YETI’s left eye LED
vWaitMilliseconds(500); //wait one a second
vFrontLEDs(OFF); //deactivate YETI’s right eye LED
vWaitMilliseconds(500); //wait half a second
endlos();
}
void Stop(void)
{
unsigned int Zeit, hour, minutes;
hour=2200;
Zeit = hour+minutes;
ucShowPositiveDecimalValueInDisplay(Zeit); // Stunde rum
endlos();
}
int main(void){ //main function entry
vInitYeti(); //initialize all microprocessor modules in the YETI
vRs232Write("\r\nYeti, Timer\r\n",16);
vRs232Write("\r\nKurt Pieper\r\n",16);
//yeti ready sound
vBeep(400,80);
vBeep(520,80);
vBeep(360,80);
vBeep(580,80);
vInitDisplay();
int seconds = 0;
int minutes = 58;
int hour = 2100;
unsigned int Zeit;
while(1)
{
seconds++;
Zeit=hour+minutes;
if (seconds == 60)
{
seconds = 0;
minutes = minutes+1;
seconds=0;
Zeit=hour+minutes;
}
if (minutes == 60)
{
seconds = 0;
minutes = 0;
hour = hour +100;
Zeit=hour+minutes;
vBeep(400,80);
vBeep(520,80);
//Stop();
}
if (hour == 2400)
{
hour = 0000;
}
LED(); // erzeugt den Sekundentakt
ucShowPositiveDecimalValueInDisplay(Zeit);
if (seconds == 0) vBeep(100,80);
if (hour > 2459)
{
hour=100;
}
}
return 0; //terminating the main function
} //end of the main function
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
-
Foren-Regeln
Lesezeichen