byte left_vol = 45; byte right_vol = 90; ushort vol = (left_vol << 8) + right_vol; WriteRegister(REG_SCI_VOL, vol);
- Netduino Forums
- → hanzibal's Content
hanzibal's Content
There have been 386 items by hanzibal (Search limited from 10-May 23)
#58076 Networked music player using the mini
Posted by hanzibal on 12 May 2014 - 06:36 PM in Project Showcase
#57936 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 04 May 2014 - 06:28 PM in Project Showcase
I'm sorry for not being of much help here but I've never dealt with that M2Mqtt.
Did you solve the problem eventually?
#57935 Networked music player using the mini
Posted by hanzibal on 04 May 2014 - 06:17 PM in Project Showcase
SCI_VOL is a h/w register of the vs1053b chip, so you need to write the value 0x2424 to the register. You do this using the serial command interface (hence the "SCI" prefix) over SPI.
// Write to an SCI register private void WriteRegister(byte address, ushort data, bool waitForDREQ = true) { wr_buff[0] = 2; // write command wr_buff[1] = address; // register wr_buff[2] = (byte)(data >> 8); // high byte wr_buff[3] = (byte)(data & 0xff); // low byte SelectCommand(); // select SCI if (waitForDREQ) AwaitDREQ(); // wait for dreq to go high spip.Write(wr_buff); } // example of setting volume WriteRegister(REG_SCI_VOL, 0x2424);
The code snippet above is taken from my source code (puplished earlier).
I would use a rotary encoder but if you want to use a potentiometer, you can set it up as a simple voltage divider GND - 3.3V and then read the voltage of the wiper using a Netduino analogue pin. You would then need to add software to continuously poll the analogue pin for any changes in voltage, executing the corresponding volume adjustments.
#57567 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 14 April 2014 - 02:04 PM in Project Showcase
#57033 Gainspan WiFi module
Posted by hanzibal on 23 March 2014 - 07:15 PM in General Discussion
However, It can not do anything useful like accessing actual content on remote servers because of general problems reading and writing streams so there's little or no point in pblishing any code until I got those basics working.
There's probably as many recepies to writing drivers as there are chips to write them for but I think, In general the key is to read the d/s back and forth until you know your way in it, which sections contains which bits of information, where to find the info you need in various situations that you can anticipate.
Get the hang of the terminology used by the vendor and get a good feel for how the chip works and how you are supposed to use it. Ask your self the relevant questions, how can I achieve this or that required functionality and make sure you know where in the d/s the answers are.
Make up some kind of hypothetical API structure in your head and test it against what you have gathered from reading the d/s to see if your model is realistic and valid. Sometimes you can find some code for another architecture for inspiration or that you can port from but you will need to understand the chip nevertheless.
Proceed by establishing a working communication with the chip. Implement register read ops and verify by reading some expected power-on default value. Then get write ops working, verify using write and read-back testing. Write a value to some register and verify by reading back the register value to make sure it "stuck".
Come up with a programming model with some basic properties and methods supporting the model in your head. Create a class and definine the various constants, enums, register addresses and such that you will need.
Then start implementing, pick something simple like "getversion", "soft reset" or whatever is available, preferably something really simple that can be easily verified.
By now your knowledge and confidence will have grown enough to make the rest fall into place as if almost by itself.
Good luck!
#56818 Help with line of code (var rowNumber)
Posted by hanzibal on 15 March 2014 - 03:43 PM in Netduino 2 (and Netduino 1)
Of curiosity, how come you need more than 16 digits?
#56817 Sine wave
Posted by hanzibal on 15 March 2014 - 01:55 PM in Netduino Plus 2 (and Netduino Plus 1)
http://www.kjell.com...65-a2cf00ca0fb4
...but I got one so I could open it up and take som photos of the circuitry inside. Might be of help for seascan too.
#56811 Sine wave
Posted by hanzibal on 15 March 2014 - 07:45 AM in Netduino Plus 2 (and Netduino Plus 1)
The device actually did both with three separate indicator LEDs for wood beams, metal beams and for cables carrying AC. Naturally, it was very simple and can't compare with an actual metal detector.That's interesting, but a metal detector works based on a different principle.
The AC detector is pretty simple: it detects the AC voltage leveraging a capacitive coupling. Since the voltage is high, even a small coupling will have a noticeable effect. All is tuned on the 50/60 Hz.
#56800 Sine wave
Posted by hanzibal on 14 March 2014 - 08:18 PM in Netduino Plus 2 (and Netduino Plus 1)
#56785 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 13 March 2014 - 07:23 PM in Project Showcase
When re-reading my last post I realized that I may have sounded grumpy and if so, I'm sorry because I didn't mean to.Sorry post to wrong thread.
You're doing a great job Andy and I'm glad you have taken interest in this. Please do make a new post in the MCP23S17 thread and I'll do my best to help you.
#56766 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 12 March 2014 - 11:23 AM in Project Showcase
Please modify your last post, remove the code and instead attach it as a file to the MCP23S17 thread. In that new post, please also point out any specific problems that you want me to look into.
#56729 Help with line of code (var rowNumber)
Posted by hanzibal on 09 March 2014 - 08:23 PM in Netduino 2 (and Netduino 1)
Actually, the MAX 7219 and 7221 are 8 digit driver chips but they support daisy-chaining while the driver class apparently does not.
https://www.sparkfun...219-MAX7221.pdf
The solution is to modify the driver so that it supports cascading.
#56706 Netduino & RF transmitter to pair with and control smart electricity socket
Posted by hanzibal on 08 March 2014 - 11:52 AM in Project Showcase
In my home, I got a networked IR gateway (iTach) for controlling all my A/V gear and built an RF bridge for controlling wall oulets like the ones you're using. I'm using my iPhone/iPad as a WLAN remote control but it only works within the domestic LAN.
http://www.avsforum....for-itach-irule
#56696 Netduino & RF transmitter to pair with and control smart electricity socket
Posted by hanzibal on 07 March 2014 - 03:59 PM in Project Showcase
I wouldn't have my gear connected to the internet accessible from the outside world.
In some home automation product broshures, manufacturers push for things like being able to control the lighting in your home from away on vacation in another country or perhaps starting your sauna from the car on the way home. Dangerous madness.
#56689 Automated Urban Garden
Posted by hanzibal on 07 March 2014 - 06:55 AM in Project Showcase
#56685 Automated Urban Garden
Posted by hanzibal on 06 March 2014 - 09:31 PM in Project Showcase
I got one, works perfecly with iOS devices but haven't got around getting a board for my Netduinos yet and turned out there's no BT LE drivers for my good old XP box (while as it is built into Win 7).
#56684 Netduino & RF transmitter to pair with and control smart electricity socket
Posted by hanzibal on 06 March 2014 - 09:22 PM in Project Showcase
At least I think I am - of mine, not yours, that is :-)
#56671 Automated Urban Garden
Posted by hanzibal on 06 March 2014 - 11:49 AM in Project Showcase
If you need more sensors, you could try interfacing the Parrot Flower Power:
http://www.parrot.com/flowerpower/en/
It would require a Bluetooth LE module and probably hacking their protocol. The flower power is a bit expensive but there's also the SensorTag from Texas which is not miles away (not a coinsidence):
http://www.ti.com/tool/cc2541dk-sensor
#56670 Netduino & RF transmitter to pair with and control smart electricity socket
Posted by hanzibal on 06 March 2014 - 11:35 AM in Project Showcase
I've done a fair deal of similar RF control stuff too and found it very rewarding.
Very interesting and great news!
I actually didn't think Netduino was fast enough for bit-banging this (not even Netduino 2) and thought you had at least use SPI for this.
The natural next step would be adding a webbserver so that you can use a smartphone as a remote control but I guess you already thought of that.
#56613 Help with line of code (var rowNumber)
Posted by hanzibal on 04 March 2014 - 12:35 AM in Netduino 2 (and Netduino 1)
The enum is conceptionally mistreated. They way they are defined, they are not meant for you to apply arithmetics operations onto them.
Surely, as the corresponding enum values just so happens to be 0,1,2,3...etc because of the order in which they appear, you consecuently happen to get "digit1" by adding a one to "digit0". However, when adding a one to "digit7" you suddenly get "DecodeMode" instead of "digit8" which is not defined.
See what I mean?
#56604 Extensive driver for the MCP23S17 I/O expander
Posted by hanzibal on 03 March 2014 - 08:58 AM in Project Showcase
Yes but can this really be achieved with mIP 100% unchanged?Carrying the multi SPI conversation on here...
Do you think it is possible to incorporate Steffan's multi spi mgr in to your MCP23S17 driver?
Both correct and the best way to do this is probably for you to wrap the driver in another class of your own.Am I correct in saying the use of a bus is to allow for multiple port changes to be made in one write, thus increasing speed and efficiency?
If this is correct, then I also understand that I can't make a bus spanning multiple chips, however if for example I wanted to change the state of 10 pins 5 on each chip, then I could create a class that identifies which pins are on which bus and perform 2 writes one for each bus?
#56590 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 02 March 2014 - 10:30 PM in Project Showcase
As for multi SPI, I could make an interface for the internal multi SPI mgr implementation of my MCP23S17 driver and expose that from outside the class.
You would then have to make some modificatins to your local mIP code to have it use the interface supplied by me rather than accessing the SPI module directly.
The latter would probably only be a little more than search and replace but still, you would break away from the main track of mIP. This is what I meant before when talking about the lack of a standard multi SPI mgr that can be shared between code originating between different contributors.
EDIT: Just discovered, mIP also includes a multi SPi mgr (borrowed from Stefan Thoolen's Toolbox)...
#56588 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 02 March 2014 - 09:59 PM in Project Showcase
Good job!
I guess it's sort of a bug but mostly because mIP hasn't been tested with all that many routers yet
If you haven't already, could you please report your findings on the mIP CodePlex site or perhaps send a personal message about it Valkyrie-MT briefly describing the problem, what you did to fix it and the name/model of your router?
So I take it, you got TCP/IP up and running now then - that's great!
#56572 MIP tcp/ip stack running on Netduino mini !!
Posted by hanzibal on 02 March 2014 - 08:40 AM in Project Showcase
Perhaps ns info somehow gets garbled after all - maybe you could debug the method that printed the ns info earlier and see if it is actually stored like that, e.g. if in fact MIP thinks that "192.168.1.1.192.168.1.254" is the configured ns - if so, there could be some problems with string handlng during DHCP processing.
#56564 How to convert hex value stored in string to binary in string?
Posted by hanzibal on 01 March 2014 - 09:11 PM in Visual Studio
Might be possible to use something like int.Parse(...) in the other direction?
- Netduino Forums
- → hanzibal's Content
- Privacy Policy