Show Posts
|
|
Pages: 1 [2] 3
|
|
16
|
Using Arduino / Sensors / Re: Help with TMP37 temperature sensor
|
on: February 01, 2013, 11:57:43 pm
|
What result does this sketch provide (from the first link above) /*TMP37.pde * Arduino Sketch to read a TMP37 Temperature Sensor * Paul Badger * 2010 * Sensor works between 5 degrees & 100 degrees C * 20 mV / degree C * Can be used with TMP35 & TMP36 by changing voltsPerDegree */
float voltsPerDegree = 0.02; // change to 0.01 for TMP35 & 36
void setup() { Serial.begin(9600); }
void loop() { int sensorValue; float volts; float celsius; float farenheit;
sensorValue = analogRead(0); volts = sensorValue * 5.0 / 1024.0; // convert AD units to volts // convert volts to celsius celsius = (sensorValue * 5.0 / 1024.0) / voltsPerDegree; // standard conversion from celsius to farenheit farenheit = (((sensorValue * 5.0 / 1024.0) / voltsPerDegree) * 9.0 / 5.0) + 32;
Serial.print(sensorValue, DEC); Serial.print(" A/D units "); Serial.print(volts); Serial.print(" volts "); Serial.print(celsius); Serial.print(" degrees C "); Serial.print(farenheit); Serial.println(" degrees F"); }
|
|
|
|
|
17
|
Using Arduino / Project Guidance / Re: // reeftank controller guidance plz
|
on: January 31, 2013, 11:27:50 pm
|
|
I was in your position around 2 years ago when I considered making my own led controller, which over the following 12 months turned into a fully blown controller for all of my equipment i.e. return pumps, skimmer pump etc. This was initially based on a 20x4 LCD display and keypad but I am currently working on a TFT LCD with Touch screen controller.
You may find that someone else has done exactly what you require using your hardware, but the chances are slim. So, if you are going to end up with what you want then you will need to learn the programming language. Take baby steps, add one thing at a time and get that working - start with blinking a led so that you understand what you are doing.
This forum is great for answering specific questions that you may have, but you can't expect someone to teach you the language - my estimate is that my first controller would have taken in excess of 200 hours to complete, spread over 12 months but lots of that was researching how to do things.
There are quite a few threads on Reefcentral which may help get you started.
Good luck.
|
|
|
|
|
22
|
Using Arduino / Programming Questions / Re: Quick question about populating arrays
|
on: December 27, 2012, 07:28:42 am
|
Thanks to everyone for their assistance - I would have replied earlier but tonight has been my first chance to get back to my sketch. This is what I have ended up with, and it works typedef struct { byte xEEPROM; // EEPROM adresss for stored value int xPos; // Stored value for X position byte yPos; // Variable value for Y position int yValue; // Calculated % value of position x int valuePos; // X position for displaying the % value } sliderButton_t;
sliderButton_t button[10] = { {0,50,0,0,0}, {0,84,0,0,0}, {0,118,0,0,0}, {0,152,0,0,0}, {0,186,0,0,0}, {0,220,0,0,0}, {0,254,0,0,0}, {0,288,0,0,0}, {0,322,0,0,0}, {0,356,0,0,0} };
If I did not insert the zero, i.e. used {,50,,,} I got an error message "LED_Controller:33: error: expected primary-expression before ',' token" so it would appear that you need to insert a value for each of the array elements, even if it is zero. Cheers
|
|
|
|
|
23
|
Using Arduino / Displays / Re: New UTFT Lib
|
on: December 22, 2012, 06:49:22 am
|
|
Thanks for the clarification Henning - I should have mentioned that my results were for my 3.2WD screen.
Cheers
|
|
|
|
|
24
|
Using Arduino / Programming Questions / Re: Quick question about populating arrays
|
on: December 21, 2012, 06:11:29 am
|
You can. You need to enclose all the elements for a structure within curly braces and separate these groups by comms.. Essentially each array element is a group of variables instead of the individual items if a simple array. struct_type data[3] = {{1,2,3},{3,4,5},{6,7,8}};
So I can't just populate one of the elements? Would this work struct_type data[3] = {{1,,},{3,,},{6,,}};
|
|
|
|
|
25
|
Using Arduino / Programming Questions / Quick question about populating arrays
|
on: December 21, 2012, 04:34:22 am
|
This is probably a silly question but I can't seem to find the answer....... typedef struct { byte a; byte b; } button_t;
button_t values[10]; Is it possible to populate the values in one of the array elements like this: values[].a = (1,2,3,4,5......) I know this doesn't work but hopefully you will get what I am trying to do. Or do I need to do this: values[0].a = 1; values[1].a = 2; values[2].a = 3; . . . . Thanks in advance.
|
|
|
|
|
26
|
Using Arduino / Storage / Re: Sainsmart TFT touch SD shield, SD not working
|
on: December 18, 2012, 05:03:46 pm
|
I suspect this error is the reason for this "It is the version of product only with touch screen and touch controller." in the product description. Can be somewhat misleading when the top of the page has "PCB adapter SD Slot" - always read the fine print 
|
|
|
|
|
27
|
Using Arduino / Displays / Re: New UTFT Lib
|
on: December 18, 2012, 04:55:25 am
|
I am happy to report that I now have this working. Thanks to Bob and Markus for your reply's. I had been working with the previous Touch library for some time and assumed that the new calibration was meant to be run in Portrait mode, for both Touch and Screen. Henning kindly provided the results for his 3.2WD screen which worked perfectly which left only one option - I was doing something wrong  . After some more experimentation I have found that the Calibration sketch works with the LCD in Landscape mode and the Touch in Portrait mode. Now to start writing some sketches. Have a great Christmas everyone.
|
|
|
|
|
28
|
Using Arduino / Displays / Re: New UTFT Lib
|
on: December 06, 2012, 04:35:04 pm
|
Has anyone successfully used the calibration sketch on a 3.2WD screen - I am having no luck in getting it to work correctly. When I run subsequently run the Quick Draw example I get a mirror image on the long axis.
Orientation problem, easy to fix by changing the orientation value to fit your needs  I gather you mean to change the orientation of the screen and/or touch panel to either Portrait or Landscape in the initialisation?? I have tried all different combinations with different/ but still incorrect, results.
|
|
|
|
|
30
|
Using Arduino / Displays / Re: New UTFT Lib
|
on: December 06, 2012, 07:13:49 am
|
|
Has anyone successfully used the calibration sketch on a 3.2WD screen - I am having no luck in getting it to work correctly. When I run subsequently run the Quick Draw example I get a mirror image on the long axis.
|
|
|
|
|