Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

hoquet's Content

There have been 12 items by hoquet (Search limited from 20-April 23)


By content type

See this member's

Sort by                Order  

#33488 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 12 August 2012 - 04:53 PM in Netduino Go

I switched the flowcontrol to hardware by setting the handshake to RTS or RequestToSend, still no go. I switched the xbee's around again, still no go. I checked the settings on both xbees on windows by using the digi x-ctu, they both appeared to be set correctly and working fine. After switching things back and fourth, I was then always able to send from the NDG, but not receive. I switched the xbee's and still I could send from the NDG, but not receive. The problem must be on the NDG side. The code looked fine and I could find any other settings. Other users code was relatively the same as mine in working with the serialport. I then set the windows form app to continuously transmit, I then picked up the xbee and gadgeteer and moved pressed the xbee onto the gadgeteer, I received data! I had to press down very hard to receive data. I switched the xbees, they both worked as long as I pressed down hard on the xbee. Conclusion The gadgeteer is faulty. One or more of the pin receivers on the gadgeteer is not making connection to the xbee. I will need to send this back and order another one. I hope these are not the type of issues that I am going to run into. I seemed to have run into so many issues already. But managing to work my way through most of them. I guess sometimes you can't always assume that every hardware connection is working. I guess if I was going to production with an application I would have some diagnostic routines that kicked off first. It would check the connectivity of the NDG to the gadgeteer. Then diagnose the connection of the gadgeteer to the XBEE pin by pin. Thanks



#33398 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 11 August 2012 - 02:05 AM in Netduino Go

Greetings Chris,

The XBee Gadgeteer is plugged into Socket 1. I Have the Go Button plugged into Socket 5. Nothing else is plugged into any other socket.

Here is the code on the NDG side:

                serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
                serialPort.ReadTimeout = 500;
                serialPort.WriteTimeout = 500;
                serialPort.Handshake = Handshake.None;
                serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_Datareceived);
                serialPort.Open();

        private static void serialPort_Datareceived(object sender, SerialDataReceivedEventArgs e)
        {
            SerialPort spL = (SerialPort)sender;
            Debug.Print("Data Received");
        }
        static void button_ButtonReleased(object sender, bool buttonState)
        {
            Debug.Print("Button Pressed");
            string output = " Hello from your Netduino: ";
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes(output);
            serialPort.Write(bytes, 0, bytes.Length);
        }

On the windows form side I am able to receive the data from the NDG, but when I send data, I see the Gadgeteer light go on, however the event is not fired.

Here is the code on the windows form side.
            serialPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
            serialPort.ReadTimeout = 500;
            serialPort.Handshake = Handshake.None;
            serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_Datareceived);
            serialPort.Open();

        private void button1_Click(object sender, EventArgs e)
        {
            // then we will prepare sending the message
            byte[] buffer = new byte[MOVEMESSAGE.Length];
            // convert the string to bytes
            buffer = System.Text.Encoding.UTF8.GetBytes(MOVEMESSAGE);
            // write it to Xbee through serial
            if (!serialPort.IsOpen) { serialPort.Open(); }
            serialPort.Write(buffer, 0, buffer.Length);
        }
        private void  serialPort_Datareceived(object sender, SerialDataReceivedEventArgs e)
        {
            SerialPort spL = (SerialPort)sender;
            txtBox1.Text += "Data Received";
        }

The confusing part is that I can send from the NDG and receive on the windows form, but I cannot send from the windows form and receive on the NDG. However when I switch the XBee's, I can send from the windows form and receive on the NDG. But I cannot send from the NDG anymore and receive on the windows form.

Thanks



#33350 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 10 August 2012 - 04:19 AM in Netduino Go

I am having a very strange problem. I have the XBee using the gadgeteer on Socket 1 on my NDG. I am using the sparkfun xbee wireless kit. That comes with the 1mw xbee chips. I wrote a program that will initialize the Serial on COM1 then added an event handler to handle the data received. I wrote another windows form to send data via serialport and Xbee. Works great! On the windows form I write something in a textbox, it shows up on my NDG. Now, I added a button on my NDG so that when I push the button, it will write to the serialport a message. On the windows form, I added an event handler for DataReceived that should pick up the message. But it did not work. I then tried another program already written http://forums.netdui...beeusercontrol/ And I got the same results. I could not send data from the NDG to my PC. For some odd reason, I finally decided to switch the xbees from the xbee explorer on the pc and my gadgeteer. Wow, now I press the button on my NDG and it shows up on my windows form. Now when I write something in a textbox on the windows form, the NDG does't read the message. I know my code is working fine both ways. It seems that one of the Xbees is not able to transmit. Could this be a hardware issue or is there something that I forgot to do with one of the xbees or is there a mode/setting, something that I am missing? Any clues?? Thanks



#33179 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 06 August 2012 - 08:45 PM in Netduino Go

Chris, thanks for the reply. I have a good wrapper that I found for the XBEE, I am going to tweak it and I'll attach my code once I am finished. So I have the XBee Module on Socket 1 which is going to use up 1-4. I have the XBee Shield Base on Socket 5 which will take up 5-8. So now I can communicate and use motors. I still need to add a distance sensor and potentially my accelerometer. At some point the shield base will not take up the full sockets 5-8? I could just wait... Otherwise, can I put the adafruit motorshield on the Go shield base, then stack the accelerator on top of that? Bytemaster, I am going to order the wiFly module. I am looking forward to your publishing your firmware. "Nothing too hard to hand solder?" You have not yet seen my noob soldering job ;) Thanks



#33139 "Preparing to deploy..." takes ages

Posted by hoquet on 05 August 2012 - 08:18 PM in Visual Studio

This error started happening to me as I was configuring my motorshield. There was a piece of code that broke and it must have recieved some bad code that would lock up the device so that I could not connect or deploy any new code. I tried all the strategies atleast 100 times waiting 5 seconds to deploy, then waiting 5 seconds to connect usb, all the various methods that everyone in these forums have written. I gave up yesterday and ordered a new arduino uno r3. Today I sat back down and said, okay, I'm going to get this thing working. I finally found the following: http://alhardy.com.a...etduino-Go.aspx This solved it. I had to boot the board to DFU mode, then use the tools to erase and load the tinyclr.dfu. Now I'm back up and running. My suggestion to Netduino, is this: Put a reset button or jumper on the next board so that if it gets stuck in a loop or error, there is a way to clear the program that is running or reset back to factory.... Or throw another button on their to do an actual reset.. Could have saved me hours...



#33025 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 02 August 2012 - 04:56 PM in Netduino Go

Thank you Chris, this is a gadeteer module for XBEE that I am looking at: http://www.ghielectr...log/product/314 Are you saying that if I connect this module to one of the GO bus sockets, for example socket 1, then I must leave 1-4 empty? Using this gadgeteer I will not require the XBee Shield? Also, will I be able to just start working with the socket or do I need to initialize the outport for a gadgeteer xbee module? So far I have used the outport for the RGBLed, Potentiometer, button, and shield base. There are corresponding reference libraries NetduinoGo.RGBLed, etc... that I can use to communicate with those on the GoSocket. Is there a library for communicating with Gadgeteers that I need to use? Thanks hoquet



#32995 Netduino Go with Xbee module not supported yet?

Posted by hoquet on 02 August 2012 - 02:07 AM in Netduino Go

I am trying to communicate with the serial port of my netduino Go shield base. However I've read that the serial ports are not released or working with the Netduino Go. Aside from programming directly the shield base, is there any other work around that I am missing? Disclaimer: I am fairly new to the hardware side of things, so please keep it simple. Thanks



#32678 Powering the Netduino Go! with a Lipo

Posted by hoquet on 26 July 2012 - 02:20 AM in Netduino Go

If I have a LiPo 11.1v 3s 5000mAh battery with 20c discharge rate, I should be able to power the Netduino Go for a long time. I have my own rapid charger for it, so no need for a onboard charger. What are the input limits and recommendation for the Netduino Go? Is it 3.3v to 5v as recommended and 3.3v to 12v as a limit? If I have to step down to 5v, would it be best to use an external voltage regulator such as http://www.dimension...s/anyvolt-micro Thanks hoquet



#32633 Netduino Go with MMA7361 Accelerometer

Posted by hoquet on 24 July 2012 - 04:11 PM in Netduino Go

Dan T, thank you for the response and the logic.

It seems if I skip the voltage calculation and go straight to the g calculation, then convert to angle, I get quite a bit of difference in the angle of x, y, z.

With the voltage step and offsets, I get the following on angles:

X: 0.041974933800873783 Y: -0.41450604992784712 Z: 65.376588015735521
X: -0.59290646870709129 Y: 0.50895272001477965 Z: 62.864042500339835
X: -1.7474773687631002 Y: -1.107157680696504 Z: 63.763641727439321
X: -0.30431967368129509 Y: 0.39351806301346776 Z: 63.503725175255653
X: 0.44598813546831534 Y: -0.29907273468431761 Z: 63.763641727439321
X: -0.65062539850273071 Y: -0.010493732570229987 Z: 63.763641727439321
X: -0.015740598965353455 Y: 0.22036892606078706 Z: 62.864042500339835
X: 0.15740618567488954 Y: 0.047221801648020693 Z: 62.990856852350745

Without the voltage step and offsets and using 6.0g instead of 3, I get the following:
X: -2.8975050412313226 Y: 7.9588318815438672 Z: 90
X: -2.8975050412313226 Y: 9.6579297791642684 Z: 74.444248900961227
X: -2.8134508092914667 Y: 9.0623482723407758 Z: 90
X: -3.4019678954538319 Y: 10.254566768819068 Z: 82.397076755629371
X: -3.1497059167086494 Y: 10.169265624836738 Z: 85.612598169987365
X: -2.8975050412313226 Y: 10.083987254504757 Z: 80.684933454463348
X: -3.4019678954538319 Y: 7.9588318815438672 Z: 90

Without the voltage step and no offsets and using 3.0g I get the following:
X: -1.5322675849620377 Y: 4.7275420628731126 Z: 30.242639723333181
X: -1.6582412247915879 Y: 4.4327759196193295 Z: 29.275597460743235
X: -1.7842228834621141 Y: 4.6433107105722939 Z: 29.951543350138909
X: -2.0362127006474937 Y: 5.0645717506580912 Z: 28.795508763249902
X: -1.6162491506822376 Y: 4.7696615680989565 Z: 29.516487394448284
X: -1.3643141506658361 Y: 5.106712577007734 Z: 28.891348373149537
X: -1.7002341898803937 Y: 5.0645717506580912 Z: 29.323729867577644

First, I don't think I should be converting Z to an angle since it is the measure of gravity. The XL does have multiple settings to be able to switch it to 6g instead of 1.5g. I can change it, but I'm running out of digital ports. I am using most of the digital ports for the lcd.

Noob question:
How do I get more digital I/O ports?

Thanks



#32313 Netduino Go with MMA7361 Accelerometer

Posted by hoquet on 20 July 2012 - 02:16 AM in Netduino Go

While working with the Accelerometer, I noticed that the Hacktronics LCD is slow to write. It is like watching a typewriter type left to write. I am not sure if that has to do with the library I download and the code/settings, but it is slowing down my reads from the accelerometer. The code was used from here: http://10rem.net/blo...th-the-netduino Has anyone worked with an LCD using this library? Also, how is it working with the nwazet display with the Netduino Go? Thanks



#32252 Netduino Go with MMA7361 Accelerometer

Posted by hoquet on 19 July 2012 - 04:40 AM in Netduino Go

I looked over the datasheet on the MMA7361. Everything in it's reference lead me to arduino code and shields with differnt bit chips with values that didn't make sense.

I may have figured out what the values are that I am reading. I was looking for what analoginput.read was actually reading. I tried finding the information on the MMA7361 chip. After some time, I finally came across a good article about NETMF Analog input vs Microsoft SPOT http://www.tinyclr.c...m/topic?id=7832

The value I should see from a 12-bit Shield from the NetDuino Go performing analogInput.read() should be between 0 and 1 for 3.3v. The post helped. Anyways, from there I found an article on someone converting analog input to read values to degrees. http://www.dfrobot.c...1_(SKU:_DFR0143)


I understand most of the code, except for why they are subtracking 1.62, 1.74, and 1.48 from the voltage.




            // read the converted value from the sensor... this returns a double
            // between 0 (0V) and 1 (3.3V)
            analog_x = accX.Read();
            analog_y = accY.Read();
            analog_z = accZ.Read();

            // now, if we want, we can calculate the number of volts by multiplying
            // the converted value by 3.3
            vol_x = analog_x * 3.3;//convert analog_x-->voltage value(v)
            vol_y = analog_y * 3.3;
            vol_z = analog_z * 3.3;

            //range x: 0.83 - 2.41 1.62 
            // y: 0.96 - 2.53 1.74
            // z: 0.72 - 2.23 1.48

            add_x = vol_x - 1.62;//calculate the added x axis voltage value
            add_y = vol_y - 1.74;
            add_z = vol_z - 1.48;

            g_x = add_x / 0.8;//calculate the gram value
            g_y = add_y / 0.8;
            g_z = add_z / 0.8;

            if (g_x <= 1 && g_x >= -1) //We use this condition to prevent the overflow of asin(x).( If x>1 or x<-1, asin(x)=0)
            {
                degree_x = System.Math.Asin(g_x) * 180.0 / System.Math.PI;//calculate the degree value
                degree_y = System.Math.Asin(g_y) * 180.0 / System.Math.PI;
                degree_z = System.Math.Asin(g_z) * 180.0 / System.Math.PI;
            }
            //fix the overflow condition
            if (g_x > 1)
                degree_x = 90;
            if (g_x < -1)
                degree_x = -90;
            if (g_y > 1)
                degree_y = 90;
            if (g_y < -1)
                degree_y = -90;
            if (g_z > 1)
                degree_z = 90;
            if (g_z < -1)
                degree_z = -90;
            //#########################
            //print

Now the output seems a lot more reasonable, when I do tilt the board vertically, the y-axis reads 90. I will do more testing to make sure that it is calculating correctly. I'm excited, I feel like things are working...

Thanks



#32169 Netduino Go with MMA7361 Accelerometer

Posted by hoquet on 18 July 2012 - 05:00 AM in Netduino Go

Hello everyone,

This is my first mini project with the netduinoGo and learning about robotics. I have a programming background, although 10 years ago in .net. I purchased the NetduinoGo starter kit with the button, led, potentiometer, etc.. I got all of it working and was able to make buttons respond, led's blink, etc.. Cool Huh?

I then added the shield base and got that to work. Atleast blink a light and power on. Now I wanted more. So I purchased an LCD, not knowing anything about whether or not it would work or others have used it and if there is some sample code out ther. Then I managed to get an LCD screen connected through various websites and tutuorials. I finally got the Hacktronics LCD Module working with the Netduino. Someone wrote an interface and class along with diagrams on what to connect the digital I/O to the Hacktronics. I can now write out whatever I want to the LCD screen. Although all string manipulations, truncations, etc. I have to handle myself. But it works, I even learned what the heck a resistor is. I also watched a youtube video on how to solder. Hey, it has been 15 years since I took any kind of physics.

Now I thought I would try my hand at an Virtuobotix MMA7361 Accelerometer which I order even before I wrote my first Netduino application. I learned that next time before ordering the hardware, see if there is some code that people have written is readily available for c#. Trying to convert Arduino classes and interfaces is nearly impossible. Anyways, I connected the accelerometer to the shield and followed code that someone else wrote for another accelerometer: Sparkfun ADXL 335

Very basic code:
 // Define our accelerometer inputs
        static AnalogInput accX;
        static AnalogInput accY;
        static AnalogInput accZ;

        public static void Main()
        {
            // Create the Inputs
            accX = new AnalogInput(Pins.GPIO_PIN_A0);
            accY = new AnalogInput(Pins.GPIO_PIN_A1);
            accZ = new AnalogInput(Pins.GPIO_PIN_A2);

            // Keep application alive via loop
            while (true)
            {
                // Read data from the sensor
                double x = (double)(accX.Read());
                double y = (double)(accY.Read());
                double z = (double)(accZ.Read());

                // Output data to screen
                Debug.Print("X: " + x + " Y: " + y + " Z: " + z);
            }
        }
So, what do I get for an output?

X: 0.48815628815628814 Y: 0.526984126984127 Z: 0.67252747252747258
X: 0.48815628815628814 Y: 0.5252747252747253 Z: 0.6676434676434676
X: 0.48986568986568985 Y: 0.52722832722832724 Z: 0.66935286935286931
X: 0.49108669108669106 Y: 0.52576312576312578 Z: 0.66984126984126979
X: 0.48888888888888887 Y: 0.52649572649572651 Z: 0.67130647130647125
X: 0.48766788766788766 Y: 0.52747252747252749 Z: 0.66862026862026858
X: 0.48888888888888887 Y: 0.52771672771672773 Z: 0.67057387057387052
X: 0.48840048840048839 Y: 0.52503052503052505 Z: 0.66935286935286931
X: 0.4879120879120879 Y: 0.5252747252747253 Z: 0.67106227106227101
X: 0.48913308913308912 Y: 0.5252747252747253 Z: 0.66788766788766785
X: 0.48717948717948717 Y: 0.52503052503052505 Z: 0.67057387057387052
X: 0.4879120879120879 Y: 0.52551892551892554 Z: 0.66984126984126979
X: 0.49108669108669106 Y: 0.52722832722832724 Z: 0.66862026862026858
.....

Great, seems like it is working. How the heck do I veryify that it works? Even though the device is sitting on my desk at home, the numbers keep changing. I read some articles about getting the g-force, radians, and using offsets. I just want something like degrees tilt in either of the 3 axis with 2 decimal places. Any resources anyone would recommend would be great. I'll keep posting my progress as well as I add a motor shield and the xbee shield. I'm just learning, so please keep it simple. I am also attaching the work that I have done. For the hacktronics LCD which is a 4 line 20 char, I would be happy to share my code and board configuration.

Thanks

Attached Thumbnails

  • photo.JPG




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.