- Netduino Forums
- → <Jeremy>'s Content
<Jeremy>'s Content
There have been 31 items by <Jeremy> (Search limited from 27-September 23)
#18076 BinaryWriter?
Posted by <Jeremy> on 16 September 2011 - 10:51 AM in Netduino Plus 2 (and Netduino Plus 1)
#18471 Dangershield
Posted by <Jeremy> on 27 September 2011 - 08:45 AM in Project Showcase
#32207 DHT11 Temperature Sensor
Posted by <Jeremy> on 18 July 2012 - 04:22 PM in Netduino 2 (and Netduino 1)
#32238 DHT11 Temperature Sensor
Posted by <Jeremy> on 18 July 2012 - 10:38 PM in Netduino 2 (and Netduino 1)
#18868 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 06 October 2011 - 12:32 PM in General Discussion
#19047 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 11 October 2011 - 08:08 PM in General Discussion
Try this, it's only a proof of concept I put together in 20 minutes, so it's not good code or even remotely robust, but it'll get you started I hope:
Add "using System.Collections;" to the Si4703 class I uploaded before.
Also add this code to the same class.
public string PrintRadioName() { int j = 0; string token = ""; string fullRadioName = ""; while (true && j < 500) { j++; this.ReadRegisters(); if ((this.Si4703_Registers[Si4703.STATUSRSSI] & (1 << Si4703.RDSR)) > 1) { var radioNameSoFar = this.ReadRadioName(); if (radioNameSoFar != null) { if (token != (string)radioNameSoFar.Value) { token = (string)radioNameSoFar.Value; fullRadioName += radioNameSoFar.Value; } if (fullRadioName.Length > 16) { return fullRadioName; } } } } return string.Empty; } public DictionaryEntry ReadRadioName() { if ((this.Si4703_Registers[RDSB] >> 11) == 0 || (this.Si4703_Registers[RDSB] >> 11) == 1) { int Dh = (this.Si4703_Registers[RDSD] & 0xFF00) >> 8; int Dl = (this.Si4703_Registers[RDSD] & 0x00FF); int infoOrder = (this.Si4703_Registers[RDSB] & 0x00FF); var radioName = new System.Text.UTF8Encoding(); byte blockerrors = (byte)((this.Si4703_Registers[STATUSRSSI] & 0x0600) >> 9); //Mask in BLERA DictionaryEntry d; if (blockerrors == 0) { if ((Dh >= 32 && Dh <= 127) && (Dl >= 32 && Dl <= 127)) { var radioChars = radioName.GetChars(new byte[] { (byte)Dh, (byte)Dl }); d = new DictionaryEntry(infoOrder, "" + radioChars[0] + radioChars[1]); return d; } } } return null; }
And call the "PrintRadioName" method after you tune to a radio station with a strong signal. If there's something there, it should return it into a string variable. I was able to get some RDS information with this, so hopefully it'll work in your part of the world too. Anyway, give it a try and let me know what happens.
Jeremy
#19056 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 11 October 2011 - 10:55 PM in General Discussion
( (this.Si4703_Registers[RDSB] & 0x00FF) & 0x3) * 2;
So this time, each of the pairs of letters will be associated with the numbers 0, 2, 4, and 6, and therefore you can determine the correct order of the letters and what letters come first.
Jeremy
#18815 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 05 October 2011 - 10:52 AM in General Discussion
#19054 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 11 October 2011 - 09:37 PM in General Discussion
What might be interesting to you as well is if you want to see the radio text information, you can use
if ((this.Si4703_Registers[RDSB] >> 11) == 4 || (this.Si4703_Registers[RDSB] >> 11) == 5) { int Ch = (this.Si4703_Registers[RDSC] & 0xFF00) >> 8; int Cl = (this.Si4703_Registers[RDSC] & 0x00FF); int Dh = (this.Si4703_Registers[RDSD] & 0xFF00) >> 8; int Dl = (this.Si4703_Registers[RDSD] & 0x00FF);
... and convert to ascii, and then the rest of the code goes here, with minor modifications
That's an interesting question about the two boards from one Netduino. I don't know enough about the I2C protocol right now to answer that unfortunately. If you've got two FM boards (even if the first one is only partially working) you might be able to try it, but I guess you might have to revisit the original code and try to eliminate static variables. I don't know how two devices with the same device identifier on the same I2C pins would work - I'd guess it would conflict, because the netduino can't determine which device to talk to at any one time? But it's just a guess.
Cheers,
Jeremy
#18853 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 06 October 2011 - 10:20 AM in General Discussion
#18802 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 04 October 2011 - 09:48 PM in General Discussion
Attached Files
- AbstractI2CDevice.cs 2.13KB 52 downloads
- Program.cs 971bytes 42 downloads
- Si4703.cs 12.75KB 71 downloads
#18809 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 05 October 2011 - 07:41 AM in General Discussion
#18765 Help porting Arduino code for FM radio module
Posted by <Jeremy> on 04 October 2011 - 12:58 PM in General Discussion
#18015 HMC5883L Magnetometer Netduino Code
Posted by <Jeremy> on 14 September 2011 - 09:54 PM in Project Showcase
Attached Files
- HMC5883L.cs 4.73KB 225 downloads
- AbstractI2CDevice.cs 1.9KB 170 downloads
- Program.cs 588bytes 173 downloads
#21554 HMC5883L Magnetometer Netduino Code
Posted by <Jeremy> on 10 December 2011 - 06:10 PM in Project Showcase
#32361 Increasing the resolution of the system timer
Posted by <Jeremy> on 20 July 2012 - 03:18 PM in Beta Firmware and Drivers
#32863 Increasing the resolution of the system timer
Posted by <Jeremy> on 29 July 2012 - 12:27 AM in Beta Firmware and Drivers
#32859 Increasing the resolution of the system timer
Posted by <Jeremy> on 28 July 2012 - 11:31 PM in Beta Firmware and Drivers
#18153 My first project with netduino
Posted by <Jeremy> on 18 September 2011 - 07:23 PM in Project Showcase
#32410 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)
Posted by <Jeremy> on 21 July 2012 - 09:56 AM in Beta Firmware and Drivers
#32432 Netduino Firmware v4.2.0 RC5 (Netduino + Netduino Plus)
Posted by <Jeremy> on 21 July 2012 - 06:26 PM in Beta Firmware and Drivers
#18035 Netduino Plus + ID-20 (again!)
Posted by <Jeremy> on 15 September 2011 - 08:08 AM in Netduino Plus 2 (and Netduino Plus 1)
#18766 PCB
Posted by <Jeremy> on 04 October 2011 - 01:01 PM in General Discussion
#18810 PCB
Posted by <Jeremy> on 05 October 2011 - 08:16 AM in General Discussion
#17758 Reading data chunks from a COM port question
Posted by <Jeremy> on 08 September 2011 - 01:58 PM in Netduino 2 (and Netduino 1)
- Netduino Forums
- → <Jeremy>'s Content
- Privacy Policy