support vma444

Installatie
The VMA444 is a radio and RDS receiver combined with an efficient 150 mW audio amplifier. This module is ideal if you want to create your own clock radio or if you want to add FM functionality to your projects.

VMA444 pin configurartie
VMA444 PIN Arduino PIN Description
5V 5V Supply voltage
GND GND Ground
SDIO Analog pin A4 Data
SCLK Analog pin A5 Clock
RST Digital pin D2 Reset

As with any receiver, the VMA444 needs an antenna. The VMA444 antenna is connected to the grounding of your earphone cable, so an earphone or audio cable has to be plugged in to operate the VMA444 properly.
Download de Arduino library op VMA11 en installeer met menu sketch>libraries>add from zip.

Voorbeeld van basis sketch:

#include "VMA11.h"
#include "Wire.h"
int resetPin = 2; // these are the connections between VMA444 and the Arduino UNO
int SDIO = A4;
int SCLK = A5;
VMA11 radio(resetPin, SDIO, SCLK);
int channel;
int volume;
char rdsname[9];
char rdsrt[65];
char previousRadioText[65];
uint8_t lastChar;

void setup()
{
	Serial.begin(9600);
	Serial.println("\n\nVMA11 Test Sketch");
	Serial.println("===========================");
	Serial.println("a b Favourite stations");
	Serial.println("+ - Volume (max 15)");
	Serial.println("u d Seek up / down");
	Serial.println("r Listen for RDS Data (15 sec timeout)");
	Serial.println("R Listen for RDS Data (15 sec timeout)");
	Serial.println("Send me a command letter.");

	radio.powerOn();
	radio.setVolume(1);
	volume=1;
	radio.setChannel(1021);
	memset(previousRadioText,0,65);
	memset(rdsrt,0,65);
}
void loop()
{
	if(radio.readRDSRadioText(rdsrt)){
		if(strcmp(rdsrt,previousRadioText)){
			Serial.println(rdsrt);
 			strcpy(previousRadioText,rdsrt);
 		}
	}
 	if (Serial.available()){
		char ch = Serial.read();
 		if (ch == 'u') {
			channel = radio.seekUp();
			displayInfo();
		} else if (ch == 'd') {
			channel = radio.seekDown();
			displayInfo();
		} else if (ch == '+') {
 			volume ++;
 			if (volume >=16) volume = 15;
 			radio.setVolume(volume);
			displayInfo();
 		} else if (ch == '-') {
 			volume --;
 			if (volume < 0) volume = 0;
 			radio.setVolume(volume);
 			displayInfo();
 		} else if (ch == 'a') {
 			channel = 1015; // Rock FM
 			radio.setChannel(channel);
 			displayInfo();
		} else if (ch == 'b') {
			channel = 925; // KBCO in Boulder
 			radio.setChannel(channel);
 			displayInfo();
 		} else if (ch == 'r') { 
 			radio.readRDSRadioStation(rdsname);
			Serial.println(rdsname);
 		} else if (ch == 'R') {
 			radio.readRDS(rdsname,rdsrt,&lastChar);
 			Serial.println(rdsrt);
 		}
 	}
}

void displayInfo()
{
 Serial.print("Channel:"); Serial.print(channel);
 Serial.print(" Volume:"); Serial.println(volume);
}