Merge branch 'master' of mjesec.ffzg.hr:/git/Arduino
[Arduino] / c2_ulx3s_test / rds.cpp
1 /* FM antenna test
2  * Tune FM radio to 107.9 MHz
3  * Bring ULX3S within 1 m distance of radio antenna
4  * You should hear silence.
5  * RDS display should show: "TEST1234"
6  * RDS long message (optional on some radios): "@ABCDEFGHIJ.."
7  */
8  
9 #include <RDS.h>
10
11 RDS rds = RDS();
12
13 uint16_t pi = 0xCAFE;
14 char ps[9] = "TEST1234";
15 char rt[65] = "ABCDEFGH";
16
17 void rds_init() {
18   int i;
19   for(i = 0; i < sizeof(rt)-1; i++)
20     rt[i] = '@'+i; // ascii map
21   /* Setup initial RDS text */
22   rds.pi(pi); // station numeric ID
23   rds.stereo(0); // 0-Inform over RDS that we send Mono, 1-Stereo
24   rds.ta(0);  // 0-No, 1-Traffice Announcements
25   rds.ps(ps); // 8-char text, displayed as station name
26   rds.rt(rt); // 64-char text, not every radio displays it
27   rds.Hz(107900000); // Hz carrier wave frequency
28   rds.length(260); // bytes message length (260 default)
29 }