I am putting 3.3 Volts from the Hydra through it. I am using pin 1 for the power. The same configuration on another controller gets accurate reads of 1.64 volts at zero g. I am wondering if I am reading the pins wrong. I have used this layout:
Perhaps they are backwards?
Strangely when I run the the ports with a multimeter I get 3.3 v on the number 10 which should be ground…
I am not familiar with Hydra and Gadeeter but reading 1023 shows that ADC saturates. This can be due to bad connection (plugging an unapropriate sensor into the socket, or plugging a sensor into an unapropriate socket). Maybe someone that has hydra or gadeeter can have a look on the values you have measured.
I have put the ain1 onto the ground and it reads 1023. I have tried it on 2 fez hydras. I think it is a problem with my code or how I am initializing the analog ports.
The analog ports are 13 and 14 correct?
Pins 13 and 14 are also socket type Y. Do I have to initialize the port as an analog port? All I am writing is:
var ain1 = new AnalogIn(AnalogIn.Pin.Ain1);
var ain2 = new AnalogIn(AnalogIn.Pin.Ain2);
I am completely baffled by this. I have never had problems reading an analog on any other platforms including the Panda II. I have not been able to find any simple examples in the code section using analog with hydra. It must be something very simple I am missing…Any more suggestions?
I don’t know the exact format of this, but there’s a Gadgeteer AnalogIn reservation process - what you’re seeing (I suspect) is that the pin AnalogIn.Pin.Ain1 does not map to where you think it is. You could try trial and error to move the point you’re connected in to see if you can find the one that changes as you connect it to GND?
That is what I suspect. I have tried all the pins using just that code and it absolutely does not work. The problem is I cannot find a simple example of the analog read for the Hydra somewhere. The documentation is really geared towards the Panda. When I start a new application for the hydra I am just using a console application. I will mess around with the gadgeteer project type. If anyone has a simple analog read example for the Hydra it would be great if you could post it. I don’t really know if I am missing a reference or what the initialization process is wíth the gadgeteer. I will be happy to add it to the code section if you can share it…
Most things discussed about the Hydra are going to be Gadgeteer related.
There are no pin enums that I can see (without digging into code) in the standard includes even in a Gadgeteer app. That is the only thing you are missing, how to access the specific pin in the specific socket you want.
If I were wanting to explore this deeper I would look at the source code for the GHI Potentiometer and see what it does under the covers.
Use the eblock expansion in the gadgeteer designer, and then the above code should give you what you need, based on pin 2.
From the OSHW API reference, there’s no specific info that I can see that maps AnalogIn.Pin.AinX pins to physical pins on the Hydra hardware. So (in my view) the best chance is still to use the Gadgeteer abstraction and find it that way
I am new to Gadgeteer, so excited to join you guys. I have a FEZ Hydra and am trying to figure out the pin mappings as well as, well most things really :).
What I have done so far is to use an extender module on the analog (A) sockets (13 & 14) and then test which pins (from 3-5, see GHI Electronics – Where Hardware Meets Software) map to the pins Ain0 to Ain5 (I assume these are the only 6 analog pins) and this is what I have so far:
Pin3 : Ain4
Pin4 : Ain3
Pin5 : Ain1
Pin3 : Ain5
Pin4 : Ain2
Pin5 : Ain0
If anyone wants to double-check that to confirm, that would be great.
I would also like to know how to map the digital pins, for example, if I am using Socket Type A and want to set Pin6 to a digital output pin, how do I find out how to define it according to the FEZHydra.Pin Object?
Also, is there a way to define a pin in terms of the extender module instead of through the FEZHydra.Pin Object?
@ Architect: Thanks!
I think there is a snag. To use a 16 channel multiplexer I need 4 digital outputs and 1 analog input. According to the Sockets, the best I can do is to use an A socket and use two of the analog pins (Pin3 & Pin4) as digital pins and the GPIO pin as well, which makes 3 digital outputs and 1 analog input. I suppose I will just have to use more than one socket to get that extra digital pin. Unless there is another way anyone can think of???
So you need 5 pins, right? One AnalogIn. 4 GPIO. And you have a Hydra? If so then you just need to use the AY socket (socket 14) or the AT socket (socket 13). That has the Analog In pins you need plus the ones marked [UN] on the analog socket definition are connected to digital IO pins.