blob: 8b1fcd7125e7a8677939c3d54cd337feda7c8617 [file] [log] [blame]
Gordon Henderson25e4ec52012-12-06 21:49:41 +00001
2#include <stdio.h>
3#include <errno.h>
4#include <string.h>
5
6#include <wiringPi.h>
7#include <softTone.h>
8
9#define RANGE 100
10#define NUM_LEDS 12
11
12int scale [8] = { 262, 294, 330, 349, 392, 440, 494, 525 } ;
13
14int main ()
15{
16 int i, j ;
17 char buf [80] ;
18
19 if (wiringPiSetup () == -1)
20 {
21 fprintf (stdout, "oops: %s\n", strerror (errno)) ;
22 return 1 ;
23 }
24
25 softToneCreate (3) ;
26
27 for (;;)
28 {
29 for (i = 0 ; i < 8 ; ++i)
30 {
31 printf ("%3d\n", i) ;
32 softToneWrite (3, scale [i]) ;
33 delay (500) ;
34 }
35 }
36
37}