|
|
|
Supreme Being
      
Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640,
Visits: 819
|
|
| Danny, Nowhere does it say that the IOWizard supports servos...Only the Serializer supports servos. So, you'll never get those to work w/ the IOWizard. LoL Best Regards,
Jason Summerour President, Summerour Robotics Corporation www.roboticsconnection.com
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640,
Visits: 819
|
|
| Danny, One more note, you will want to ignore ADC values returned from the IOWizard for the pins which do not have anything plugged into them. Those values will 'float' based on adjacent ADC readings, and is a function of the microcontroller. You will know which pins have sensors plugged into them, so you will know which readings to pay attention to.  NOTE: Each 10‐bit analog value is returned in two bytes. So, you will have to shift the first (upper) byte by 8, and then add the subsequent (lower) byte to that shifted value to arrive at a 10‐bit integer value. See the pseudo code below for an example: Pseudo code: Int adc; int value; … adc = i2c_read(1) ; value = adc << 8; value += i2c_read(1); Best Regards,
Jason Summerour President, Summerour Robotics Corporation www.roboticsconnection.com
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640,
Visits: 819
|
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55,
Visits: 139
|
|
This is the part that is confusing.. you say there are two bytes returning but there are 10 bits..
8 bits per byte - please clarify this...
-Danny
Animusoft
RUG Community
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55,
Visits: 139
|
|
OK so I think I understand what you are saying. Been playing around with the math to derive this its consistent with the ambient temperature sensor.
Now my question to you is the following - if I have additional sensors - say a PING))) ultrasonic range finder - I am assuming i need to understand how the sensor works and sends commands to it as it expects via I2C.
If this is the case - what do you recommend? Either for the PING))) or the Max EZ Sonars you have on the RC.com site? I have tried finding out more information in regards to these sensors but have no luck finding the information I require.
When I plug in the PING))) sensors I can at least get the LED to turn on and off but I cannot get an accurate reading. or better said I do not understand how to get a reading from it.
-Danny
Animusoft
RUG Community
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55,
Visits: 139
|
|
Jason,
So I have been trying to get a reading from the PING))) sensor on GPIO 0 of the IOWizard with little resolve. Here is a code snippet I was doing to test this functionality after reading some things from society of robots website about the ping sensor.
using System;
using System.Threading;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
RoboticsConnection.Serializer.Serializer serializer = new RoboticsConnection.Serializer.Serializer();
serializer.BaudRate = 19200;
serializer.PortName = "COM5";
serializer.Units = RoboticsConnection.Serializer.Ids.Units.Metric;
serializer.StartCommunication();
//Make the I/O pin an Output
//Bring LOW the pin that the PING rangefinder is connected
//Bring the pin HIGH for 5 microseconds
//Bring the pin LOW
//Make the I/O pin an Input
//Wait until the pin goes HIGH
//Use a timer to see how much longer it takes for the pin to become LOW
//The time it took to become low is now our raw distance ( in microseconds)
//Divide Raw Distance by two since it includes the time for a return trip of the sonar
//Raw distance * 2257 is our distance in cm
//Raw distance * 889 is our distance in inches
// 0 = output low
// 1 = output high
// 2 = input
RoboticsConnection.Serializer.Sensors.I2CDevice iowizard = new RoboticsConnection.Serializer.Sensors.I2CDevice(serializer);
string result = string.Empty;
result = iowizard.Write(0x64, "1 0 0");
Console.WriteLine(result);
result = iowizard.Write(0x64, "1 0 1");
Console.WriteLine(result);
result = iowizard.Write(0x64, "1 0 0");
Console.WriteLine(result);
result = iowizard.Write(0x64, "1 0 2");
Console.WriteLine(result);
for (int i = 0; i < 100; i++)
{
result = iowizard.Read(0x64, "20");
Console.WriteLine(result);
Thread.Sleep(100);
}
serializer.StopCommunication();
}
}
}
Is there a way to use built in serializer commands such as pping to actually query a sensor on the iowizard or must they be coded by hand like above? I am a bit thrown back if I have to code these all up for each sensor.I imagined that the IOWizard combined with the serializer would have some kind of support for this already built in.
Either way please let me know.
-Danny
-Danny
Animusoft
RUG Community
|
|
|
|
|
Forum Guru
      
Group: Moderators
Last Login: Wednesday, March 16, 2011 1:17 PM
Posts: 73,
Visits: 96
|
|
I had to find an IOwizard that would fail when a sharp sensor was plugged into it. Mine works fine so I would say it is a borderline situation. What I believe is happening is that the sharps draw a lot of current when the led on them is pulsed. It averages out to not much, but the pulses must be enough to put noise on the power lines enough to confuse the pic.
However when I added a 1uf cap across power and ground on the iowiz it started acting normally. I tried it at the connector itself, as well as at the programming connector. So if you can solder, you can place a surface mount cap between the Power and ground pins on the bottom of the board, or use a through hole cap an put in in the power and ground holes on the programming header. Any cap 1uf or larger should be ok. Please note that the silkscreen is a little offset so that that labels for the programming holes are off a bit (on older Iowizards).It is the last 2 holes though near the analog port, Ground is the very last hole(nearest the analog port) and Vcc is next to it.
Jason will post a picture later.
I'll add some extra caps in future builds.
Ringo
Ringo Davis
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55,
Visits: 139
|
|
Have you used any sensors on the GPIO ports of the IOWizard? Can one use the built in functions in the serializer to span across to the IOWizard -or must one code to get the information from the sensor?
Please refer to my previous comment with the code example to understand what I am trying to say.
-Danny
Animusoft
RUG Community
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640,
Visits: 819
|
|
| Here are some closeups...Please note the capacitor lead polarity (anode/cathode) in 3rd image. 


Jason Summerour President, Summerour Robotics Corporation www.roboticsconnection.com
|
|
|
|
|
Supreme Being
      
Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640,
Visits: 819
|
|
| If you have a sensor connected to the Serializer, use the serializer protocol or .NET lib objects to talk to that sensor directly. If you have a sensor connected to the IOWizard, and the IOWizard connected to the Serializer via I2C, then you must query that sensor thru the Serializer via I2C (using the Generic I2C Object that's used in the attached example app above). The ONLY interface between the Serializer and the IOWizard is the 4 wire I2C interface. You can't short circuit anything w/ jumpers if that's what you're asking.
Jason Summerour President, Summerour Robotics Corporation www.roboticsconnection.com
|
|
|
|