I am trying to use temperature module with no luck, do you know if this is possible ?
which port should I use ? note will use TE35 display module too
I am getting this error:
Module TemperatureHumidity cannot be used with invalid socket number
temperatureHumidity = new TemperatureHumidity(5or 6);
temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);
temperatureHumidity.StartContinuousMeasurements();
Cobra2 will use this module on sockets 1,3,4,5, or 6. Seems like you’re not using a Gadgeteer app and defining it correctly, or you’re duplicating something. The code you mention above, is that in your ProgramStarted()? Did you include the module in the designer and drag the connection to 5 or 6?
… and thinking about it, Gadgeteer framework doesn’t know what sockets you have until the mainboard is instantiated and initialised, that’s possibly what your error is telling you.
Do the “step 1” test and then look at the main() in Program.Generated, to use the Gadgeteer “driver” as-is you need to “replicate” that. But you can equally create a new “driver” that leverages the Gadgeteer driver code and uses the pins you need - you’ll see typically the driver allocates the socket, and then allocates the pins it needs from the socket; you’d simply allocate the pins you need and that’s it.
so I can initialize with the class without inherence from Gadgeteer.Program
GHIElectronics.Gadgeteer.FEZCobra_II c = new GHIElectronics.Gadgeteer.FEZCobra_II();
temperatureHumidity = new TemperatureHumidity(5);
temperatureHumidity.MeasurementComplete += new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);
temperatureHumidity.StartContinuousMeasurements();