Show Posts
Pages: [1] 2 3 ... 291
1  Using Arduino / Programming Questions / Re: AREXX AAR ROBOT - BLUETOOTH HC-06 NEED HELP PLS on: Today at 06:58:58 am
i did a programm and i also posted it in my early reply..but its not working
Ignoring for the moment the fact that the program you posted has all the motor control stuff in it, what do you see when you print the bytes received from Bluetooth ?

In your program you have
Code:
  if (mySerial.available())
    Serial.write(mySerial.read());  <<<<Why are you throwing away this incoming byte ?
  if (Serial.available())
    mySerial.write(Serial.read());
  digitalWrite(6,LOW);
  digitalWrite(5,LOW); //stop motors
  digitalWrite(9,LOW);
  digitalWrite(10,LOW); //stop motors 
  if (mySerial.available() > 0)
  {          // if received UART data
    incomingByte = mySerial.read();        // raed byte     <<<<Assuming that more than one byte was available above you are now reading the second byte from Bluetooth

What is the format and type of the data being sent via Bluetooth ?
2  Using Arduino / Programming Questions / Re: Need help with storage of multiple ints on: Today at 06:45:57 am
Paul - quite right of course.  When I said delete I had in mind what I suggested in reply #1, although looking back I suggested that entries could not be deleted from the array which is actually not true.
3  Using Arduino / Programming Questions / Re: AREXX AAR ROBOT - BLUETOOTH HC-06 NEED HELP PLS on: Today at 06:06:04 am
Quote
I already did a programm ....it also did prgoram that can follow a black line...something like that...
OK then, let's turn the advice on its head.  Take out all of the robot control stuff from your program just leaving the Bluetooth stuff.  What do you see on the Serial monitor when/if data is received via Bluetooth ?
4  Using Arduino / Programming Questions / Re: Keep maximum value with analog reading on: Today at 06:02:44 am
Quote
Not comparing to the last value but to the known maximum value ...
As I suggested earlier.....
5  Using Arduino / Programming Questions / Re: Need help with storage of multiple ints on: Today at 06:00:35 am
Code:
int time[50];
No.  You need
Code:
unsigned long timeStored[50];
because as I noted earlier millis() returns an unsigned long

Quote
how do i then make it put the time and value together, so that it knows which value entry, has which time entry?
By using the same array index for both.

Quote
Won't millis rollover, after some time?
No, because you will use a construct like
Code:
if (millis() - timeStored[x] >= interval)
to test whether the time has passed to delete entry x from the array of tag numbers.  By using unsigned longs and subtracting them from millis() the rollover problem is avoide.
6  Using Arduino / Programming Questions / Re: AREXX AAR ROBOT - BLUETOOTH HC-06 NEED HELP PLS on: Today at 05:00:59 am
As Paul suggests I would start by getting the robot to move under control of the program.  To help this I would create functions to move the robot forward, backward, left, right and stop and call them in sequence from setup() to ensure that each one does what is required.  Then you can move onto control via bluetoooth and possibly passing a speed parameter to each function.
7  Using Arduino / Programming Questions / Re: Keep maximum value with analog reading on: Today at 04:50:27 am
Quote
do you have any better approach ?
Set a variable to zero
If the analogue input is greater than the variable then set the variable to the input value

No need for an array
8  Using Arduino / Programming Questions / Re: Need help with storage of multiple ints on: Today at 04:46:46 am
Quote
The arduino then has to store 875 for 5 minutes. so that if 875 is scanned again, it can go through the array, and know that exactly this tag, has already been scanned before, within 5 minutes.
In order to know that the number has been stored for 5 minutes you will need to store the time at which it was stored.  Unless you have an RTC you will need to store the value of millis() as the start time.  millis() returns an unsigned long integer which takes 4 bytes to store which increases the storage requirement considerably,
9  Using Arduino / Programming Questions / Re: Need help with storage of multiple ints on: Today at 03:03:04 am
Quote
i have to store a lot of integers at a time. like maybe 40-50 at the same time, for 5 minutes.
This sounds like you should be using an array to store the ints.  True that will use a fixed amount of memory but it will not expand once declared and you can store 50 ints in 100 bytes of memory using an array.  You cannot delete the entries in the array but you could set them to a value indicating that the entry is not currently valid or create a second array of bytes to hold a list of currently valid array entries.

It would be easier to provide advice if you were to expand further on what you are doing.
10  Using Arduino / Programming Questions / Re: ReadASCII String Example Problem on: Today at 02:03:13 am
You didn't answer my question about how you have got the line ending set in the Serial monitor.  The program is looking for a Newline character at the end of the input.  If it is not there then the program will not work.
11  Using Arduino / Programming Questions / Re: QLOCKTWO project on: September 21, 2014, 06:12:51 am
Quote
The code exceed the mas characters so please use the top imgur link
Why not attach the code to your post using the Additional Options.. link at the bottom left of the edit window ?  We cannot copy an image into the IDE to see the program fully, edit it or copy from it.
12  Using Arduino / Programming Questions / Re: Ignoring IF statment. on: September 21, 2014, 04:49:40 am
Code:
if(val=='F');
The trailing semi-colon is your problem.  It is the only piece of code executed if the test is true.
Check out the Arduino reference for the syntax of the if command.
13  Using Arduino / Programming Questions / Re: i want to know how to write this syntax on: September 20, 2014, 04:18:37 pm
Code:
PINC.7
What is this meant to be ?  Bit 7 of PINC perhaps ?  Please clarify what you are trying to do.
14  Using Arduino / Programming Questions / Re: How to read 500 readings from analog input block in 1 second in simulink? on: September 20, 2014, 05:11:41 am
Quote
I am using simulink as it can convert the blocks in simulink into c conde and burn it into the arduino, without actually writing any code.
Except when the simulation program won't do what you want....

It sounds like you are going to have to write some code yourself.  I assume that what you are calling a vector is an array.  It seems odd that Simulink only allows a one element one dimensional array as that is about as much use a a chocolate teapot and might just as well be a normal variable. 

What sort of data do you want to store ?  If they are ints them a 500 element array will use half of the memory available on a Uno, which is not a good start.  What sort of manipulation do you want to do on the Arduino and how will the results be output ?
15  Using Arduino / Programming Questions / Re: ReadASCII String Example Problem on: September 19, 2014, 02:07:08 am
What do you see on the Serial monitor ?
What have you got the line ending set to in the Serial.monitor ?
Pages: [1] 2 3 ... 291