Show Posts
Pages: 1 ... 48 49 [50] 51 52 ... 252
736  Using Arduino / Project Guidance / Re: How to make arduino recognize a pair of numbers and turn on an led. on: May 17, 2014, 09:11:54 pm
Ok, that's easy enough and there are a few ways to do it, but the most common way it to use a container "Packet". You want to send the data as < value1 , value2 >. If the first char is '<', then collect the rest until the serial monitor receives '>'. A comma is a good way to split the data into multiple parts, so you will need that too.

So it would be something like this.
Quote
if(Serial.available() > 0){
    char temp = Serial.read(); // example incomming data <1,23,456,7890>
    if( temp == '<' ) // find this char in the buffer, and start collecting the rest after it.
    {
    while( true ) // just a loop to continuously gather the rest of the chars
     // another Serial.available and Serial.read() here.

     //look at the incoming char and see if it is a comma or the end of the container '>'
     // if it in not a comma or >, then store the char(s) into a temporary array
     // if the char IS a comma then increment the arrays index by 1 to store the next char(s)

     // keep doing this until the incoming char is > then break out of the while loop and you should have all your data

I have a working example if you want to take a look at it.
737  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 07:08:22 pm
Library is updated with new functions, HorBarGraph and VertBarGraph. Go back to previous post and re-download.
Look at Horizontal_BarGraph example to see how it is used.

I also added your username to the .h file.
738  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 06:28:11 pm
Oh ok, so the other way around, instead of being a slider, you want a bar graph. Yea I can do that.
739  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 05:56:03 pm
Quote
edit: also the HorSlider and VertSlider functions can they be used as a display?  for instance analogRead(A0) map the values from 0-100 then use those as a display?
? What kind of display? They return 0-100 as a percent, so what else do you have in mind?

Updated library with new Gauges (10 Max)

Also all _Draw functions, (TouchButton_Draw, LatchCircle_Draw, TouchTriangle_Draw. . . etc) are now able to have centered text, they don't limit the text to the size of the "button", sorry too much code for that.
See the Latching_Buttons example.

Question for everyone else.
The library is kinda getting out of hand with all the structs, so if anyone has a better alternative, please share it. At first I was thinking of making everything into individual classes, but then everyone would need to drastically modify there sketches to use them. So if anyone has any ideas, please share and I will see what I can do.
740  Development / Other Software Development / Re: New TFT Extension Library on: May 17, 2014, 04:27:06 pm
I could make it so you could have more than one guage, let me modify the library.
741  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 06:26:59 pm
Just so Im making sure I am clear joined should be the arduino ground, the 12v ground, the ground from the relay module, and the one from the motor as well?
correct.
742  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 06:23:31 pm
Do you have the 12V gnd connected to the arduino gnd, because they should be, for it to work.
743  Using Arduino / Project Guidance / Re: Making a rookie relay module mistake? on: May 16, 2014, 05:54:14 pm
Quote
The relay coils run on 12VDC, and the module has screw-terminal blocks for sturdy and reusable attachments for the external load. The signal and power inputs run through the male single-row header.

The relay board needs 12V to work properly not the 5V @ 200mA the Arduino supplies.
744  Development / Other Software Development / Re: New TFT Extension Library on: May 12, 2014, 12:56:29 pm
New game: Missile Bomber

Objective: destroy the incoming missiles and do NOT let them fall to the ground. Each missile is enough to wipe out an entire city, and if all 20 cities are destroyed, game over.

To destroy a missile, touch the center of them. 5 points for blowing up a missile, and 50 points triggers an additional missile. (6 max)

(Please keep in mind that an Arduino is not meant to display fast moving objects, so it will slow down.)

If anyone has a Due, let me know if it is any better. A small video would be helpful.
745  Development / Other Software Development / Re: New TFT Extension Library on: May 11, 2014, 04:37:38 pm
I will include those. I also need to point out that some TFT LCD you buy online may appear to have the proper UTFT and Touch libraries, but in fact they are usually modified versions(fake) made for that particular TFT display. Mine just so happens to be one of those fake displays, so I am unable to use the real UTFT library, unless I buy a new display.

But never the less I found a way around that and made this library that works for both types of displays.
746  Using Arduino / Programming Questions / Re: how can i improve my code? on: May 11, 2014, 02:35:06 pm
Quote
unfortunately, i do need to debounce. the very first sketch i did didn't use debounce and the readings were always about 7X higher than they should of been.
Do you have an oscilloscope? I'm curious as to what the meter is actually outputting.
747  Using Arduino / Project Guidance / Re: Noob Help: Car Where Its Supposed Be on: May 11, 2014, 02:32:50 pm
A high Tech approach would be to use multiple IR sensors. The bushes may/will obscure them but if you take the average of the ranges, then the higher average should indicate the cars are in the drive way. 

These can be mounted easily, but are expensive. IR Reflectance Sensor

A cheaper solution would be to maybe use laser beams and photoresistors, but with the same method of averaging the number of pins that go low. (High = not blocked, Low = blocked)
748  Using Arduino / Programming Questions / Re: how can i improve my code? on: May 11, 2014, 02:05:09 pm
You should look into interrupts. I don't think you need to debounce anything if it just sends out a pulse, but if you want efficiency then interrupts are the way to go.
749  Development / Other Software Development / Re: New TFT Extension Library on: May 10, 2014, 11:44:16 pm
I think you need to update your UTFT library. void printChar(byte c, int x, int y); should be under public: in the UTFT.h file but yours is saying it is under protected:

If you want, you can simply move the printChar function under the public access functions, save it, then it should work after that.
750  Using Arduino / Project Guidance / Re: Push Button Switch on: May 10, 2014, 06:46:29 pm
You can maybe use two of these 16-Bit Serial/Parallel-In, Serial-Out Shift Register with two 16-bit Shift-in Register and make a 20x20 keypad.
Pages: 1 ... 48 49 [50] 51 52 ... 252