Hallo Hero_123,

hier ein Beispiel mit der Möglichkeit der hörbaren Feststellung (ohne Messgeräte):

Beschreibung aus Lib-Doc zu V2.7
void sound_tone ( int interval, int time )
Ton für time ms abspielen, die Frequenz wird durch interval vorgegeben


Gebe ich für "int interval" eine Frequnez eines Tonleiter-Tones an, erzeugt der kleine Piepser nicht einmal annähernd einen passenden Ton zu einem Instrumententon (z.B. Keyboard, Flöte, ...)

Gebe ich für "int time" 20000 ein, sollte ein Ton mit der Dauer von 20 Sek. gespielt werden. Mein Nibo2 piepst noch nicht einmal eine gefühlte Sekunde lang.
(In einem früheren Posting hat "workwind" dargestellt, dass der Wert 20000 für "int time" ca. 1/4 Sek. entspricht.)

Mit gleichem von Hand eingegebenen Code erzeugt "Achim S." gleiches Ergebnis.
Vielleicht machen Achim und ich ja den gleichen Fehler, wie sehen die Ergebnisse bei dir aus.

Hier mal mein kleines Testprogramm:

Code:
#include <nibo/niboconfig.h>
#include <nibo/leds.h>
#include <avr/io.h>
#include <nibo/sound.h>
#include <nibo/delay.h>
#include <nibo/display.h>
#include <nibo/gfx.h>
#include <nibo/bot.h>
#include <nibo/iodefs.h>
#include <nibo/pwm.h>
#include <avr/interrupt.h>
#include <stdio.h>
#include "nibo/adc.h"
#define _delay_ms

int main()
{
	sei();	
	leds_init();
	bot_init();
	display_init();
	gfx_init();
	pwm_init();
	sound_init();

	leds_set_displaylight(800);
	gfx_move(30, 0);
	gfx_set_proportional(1);
	gfx_print_text("LED test");
	gfx_set_proportional(0);

	while(1==1)
	{
		if (PIND & (1 << PD4))
		{
			leds_set_status(1,5);
		}
		else
		{
			leds_set_status(2,5);
			sound_tone(100,32767);
			delay(325);
			sound_tone(0,0);
		}

		int farbe;
		for (farbe=4; farbe>-1; farbe--) 
		{
			int ledNr;
			for (ledNr=0; ledNr<8; ledNr++) 
			{
				leds_set_status(farbe, ledNr);
				delay(50);
			}
		}

		char text[20]="--  --  --  --  --";
		// Spannung
		bot_update();
		float volt = 0.0166 * bot_supply - 1.19;
		sprintf(text, "%3.2fV", (double)volt);
		gfx_move(30, 8);
		gfx_set_proportional(1);
		gfx_print_text("supply: ");
		gfx_set_proportional(0);
		gfx_print_text(text);

		// Batterie
    	float vbatt = (adc_read(AN_VBAT)-24)*0.01734;
    	char buffer[20];
    	gfx_move(30, 16);
		sprintf(buffer, "%5.2fV", (double)vbatt);
    	gfx_set_proportional(1);
		gfx_print_text("supply: ");
		gfx_set_proportional(0);
    	gfx_print_text(buffer);
 
		// sound
		sound_tone(20, 20000);
		sound_tone(40, 20000);
		sound_tone(60, 20000);
		sound_tone(80, 20000);
		sound_tone(100, 20000);
		sound_tone(120, 20000);
		sound_tone(140, 20000);
		sound_tone(160, 20000);
				
		// Headlights
		int Headlight;
		for (Headlight=0; Headlight<1025; Headlight++)
		{
			leds_set_headlights (Headlight);
			delay(1);
		}
		for (Headlight=1024; Headlight>-1; Headlight--)
		{
			leds_set_headlights (Headlight);
			delay(1);
		}
	}
	return 0;
}