Ejemplo n.º 1
0
// fonction à appeler régulièrement, pour traiter les messages de la fenêtre du simulateur
vsd simuDoLoop()
{
	MSG         msg;
#ifdef VL_MOTORS
	int i,last;
#endif
	while (PeekMessage(&msg, NULL,  0, 0, PM_REMOVE))   
	{
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}

#ifdef VL_MOTORS
	for(i=0;i<NBMOTOR;i++)
	{
		last=motorwheel[motorval[i]];
		if (1) motorval[i]+=motordir[i];
		if (motorval[i]<0) motorval[i]+=MAXMOTORVAL;
		if (motorval[i]>=MAXMOTORVAL) motorval[i]-=MAXMOTORVAL;
		if (last<motorwheel[motorval[i]]) motorcount[i]++;
	}
#endif
	simuDisplay(diodeval);
	return 0;
}
Ejemplo n.º 2
0
// fonction à appeler régulièrement, pour traiter les messages de la fenêtre du simulateur
vsd simuDoLoop()
{
#ifdef VL_MOTORS
    int i,last;
#endif

    checkAllEvents();

#ifdef VL_MOTORS
    for(i=0; i<NBMOTOR; i++)
    {
        last=motorwheel[motorval[i]];
        if (1)
        {
            motorval[i]+=motordir[i];
        }
        if (motorval[i]<0)
        {
            motorval[i]+=MAXMOTORVAL;
        }
        if (motorval[i]>=MAXMOTORVAL)
        {
            motorval[i]-=MAXMOTORVAL;
        }
        if (last<motorwheel[motorval[i]])
        {
            motorcount[i]++;
        }
    }
#endif
    simuDisplay(diodeval);
    return 0;
}