Show Posts
Pages: 1 ... 14 15 [16] 17 18 ... 229
226  Using Arduino / Project Guidance / Re: For those who are good at programming! on: June 17, 2014, 01:19:13 pm
So you need a variable to hold a value between 0 and 180, and you need two buttons to increment and decrement that variable.
That's simple, but were not going to write the code for you.
227  Using Arduino / Project Guidance / Re: [Help] Creating a menu for non touch TFT Screen on: June 17, 2014, 11:07:22 am
Rising is the transition from low to high, and falling is high to low.
AttachInterrupt Look that the pins used for the interrupts, because there are only so many per board type, and the pins a very specific.
228  Using Arduino / Project Guidance / Re: [Help] Creating a menu for non touch TFT Screen on: June 17, 2014, 10:59:29 am
Where is the button that you want to use the switch the screens?

For the button I would use an interrupt routine that looks for the button state as either "rising" or "falling"  (depending on how the button is wired). Then in the interrupt function, you would increment a counter.

For the switch statements, you could have: ( you might not need the while loop)
switch( counter % 2 )
{
  case 0:
     /* Voltage stuff */
     break;

  case 1:
     /* Current stuff */
     break;
}
229  Using Arduino / Project Guidance / Re: [Help] Creating a menu for non touch TFT Screen on: June 17, 2014, 10:23:33 am
Quote
if (xPos >= 150) {
    xPos = 0;
    TFTscreen.noStroke();
    TFTscreen.fill(250,200,200);
    TFTscreen.rect(11,0,150,118);
      }
  else {

    xPos++;
  }

Why are you constantly redrawing the lines? Only when you get a new value should the line change.

When you use the case statement, your "graphs" should be within a while loop, this way only the things related to that graph should be running and not everything. You could also use an Interrupt on the button to change the case.

On second thought, how many screens are you switching between, you might not even need case statement, just an IF/ELSE statement.
230  Using Arduino / Project Guidance / Re: [Help] Creating a menu for non touch TFT Screen on: June 17, 2014, 09:56:23 am
Post your code as either an attachment (.ino file) or in code tags( of which can be found above the smiley faces as the # button)
231  Using Arduino / Project Guidance / Re: Want to read two serial ports on demand on: June 17, 2014, 09:01:15 am
Quote
Serial.begin(2400);  // start serial to PC
Why so slow? Bump it up to 115200, its better.

Quote
But only one reader works at one time.
Of course, the arduino cannot multi-thread, it can only do things one after the other. You can give the appearance of multi-threading by switching between everything very fast, and instead of using FOR loops to cycle through and collect the data, you should use IF statements and keep track of their individual counts.
232  Using Arduino / Project Guidance / Re: [Help] Creating a menu for non touch TFT Screen on: June 17, 2014, 08:45:04 am
You can make a simple menu with case statements. just make sure you only run the things you need to per screen otherwise it will slow down your processing time.

If you need to monitor both diagrams with real time values, you can make your variables volatile, but again it may slow things down if you have too many things running.
233  Using Arduino / Project Guidance / Re: Need help with 4x4 Keypad Matrix on: June 17, 2014, 07:43:17 am
Post your code, the problem may lie there.
234  Using Arduino / Programming Questions / Re: incrementally declaring variables on: June 16, 2014, 07:59:04 pm
Use a for loop and an array to hold all the LED pins
235  Using Arduino / Programming Questions / Re: need help in my programe . on: June 16, 2014, 06:30:21 pm
Unplug all the wires then try to upload. Also can you post a better picture of your wiring?
236  Using Arduino / Programming Questions / Re: need help in my programe . on: June 16, 2014, 05:58:55 pm
I am not familiar with that error message, I though you said it was working, what happened?

There is a small button in the top right corner of the Arduino software (IDE), this new window is the Serial Monitor. The number you set in your code "Serial.begin( ??? )" must match the number in the lower right corner of the Serial monitor.
237  Using Arduino / Programming Questions / Re: need help in my programe . on: June 16, 2014, 03:34:05 pm
You need to see the values from the joystick and see if they change. If they DO, then see if these change too.
DRV1,DRV2,STRL,STRR.

To see the values, you need to add Serial.begin(9600) or (115200) -> faster in the setup() function, and have a few Serial.print( ... ) and Serial.println( ... ) in your loop.

Serial.print("Joy1: ");
Serial.print( analogRead(joy1) );
Serial.print("\t Joy2: ");
Serial.println( analogRead(joy2) );
238  Using Arduino / Project Guidance / Re: Bluetoothcommunication - modify input string on: June 16, 2014, 02:49:43 pm
Look into strtok() and atoi()
239  Using Arduino / Displays / Re: displaying time on LCD on: June 16, 2014, 02:48:10 pm
This is not the place to be asking this type of question, but for a quick answer, you need to set the cursor. lcd.setCursor(0,0); or wherever you want to show the numbers.
240  Using Arduino / Programming Questions / Re: need help in my programe . on: June 16, 2014, 02:39:29 pm
Exactly and if you want to have different deadzones for both F/B, L/R, then you can have,
Code:
void move(int z, int y, int DZx, int DZy)// DZx = left/right, DZy = forward/reverse like a graph

  //Movement varibles
  int DRV2 = map(z, 0, 512 - DZy, 255, 0);
  int DRV1 = map(z, 512 + DZy, 1023, 0, 255);
  int STRL = map(y, 0, 512 - DZx, 255, 0);
  int STRR = map(y, 512+ DZx, 1023, 0, 255);
Pages: 1 ... 14 15 [16] 17 18 ... 229