Show Posts
Pages: 1 ... 9 10 [11] 12 13 ... 290
151  Using Arduino / Programming Questions / Re: How can i make a Matrix small or any idears? on: August 11, 2014, 10:16:20 am
Quote
can i make the matrix in this code smaler
Yes.  Use an array of bytes as you have now but use the bits in each byte for the ones and zeroes.  The arrays will take 1/8th of the space.

You can access the value of each bit using bitRead().  See http://arduino.cc/en/Reference/BitRead
152  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 11, 2014, 09:33:36 am
Quote
So if I am correct this is sending 7 bytes for 7 steps on the slider.
If you are right then why send 7 bytes ?  All you need to do is to send one value between zero and a maximum that represents the position of the slider.

Code:
trackBar1.Minimum = 0;
trackBar1.Maximum = 7;
Looks like the value will be between zero and 7, ie one of eight values.

It seems to me that you need to do something like
Code:
mySerialPort.Write(Convert.ToByte(trackBar1.Value));
or even just
Code:
mySerialPort.Write(trackBar1.Value);
but please bear in mind that I know nothing about VS so I am guessing
153  Using Arduino / Programming Questions / Re: Weird LCD flicker on: August 11, 2014, 09:21:51 am
Quote
Does this look a little odd to anyone else:
Yes.  Well spotted.
154  Using Arduino / Programming Questions / Re: Button Function on: August 11, 2014, 07:10:21 am
Quote
here full code is
That won't compile either.

Quote
  // nothing happens after setup finishes.
That's because you don't have anything in the loop() function
Code:
void loop()
{
  // put your main code here, to run repeatedly:
}

When you read the button press in setup() all that happens is that the initializingsdcard variable is declared but is not given a value.  As it is not a global variable its value could be anything but that does not matter because it is never checked or used.
Code:
  buttonState = digitalRead(buttonmenu);  // read the state of the pushbutton value:
  if (buttonState == HIGH)
  {     // check if the pushbutton is pressed.
    int initializingsdcard;
  }
155  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 11, 2014, 06:53:09 am
Quote
thats correct I am wanting the LED colours to change depending on the position of the slider.
Sending the same character each time the slider moves is not going to work then.  Why not just send a number that represents the position of the slider and use the Arduino to convert this number to an RGB combination ?  How many RGB steps do you want to display ?  This will determine the range of the number to be sent to the Arduino.
156  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 11, 2014, 05:47:27 am
Quote
I cannot get the trackbar to fade through the RGB colours.
Do you want the fade to happen automatically on receipt of an 'a'  or do you want the fade to move to the next step each time an 'a' is received ?

I am not familiar with trackbars in VS but it is possible that you want the RGB colour on the Arduino to change depending on the position of a slider in VS.  If that is the case then you would need to send a value corresponding to the position when it is changed rather than the same character each time.

Can you please expand on your requirements ?
What have you tried ?  There must be dozens of examples on the Web and in this forum.
157  Using Arduino / Programming Questions / Re: Weird LCD flicker on: August 11, 2014, 04:09:57 am
I'm glad that you got it working but it does not explain what the problem was.
158  Using Arduino / Programming Questions / Re: Weird LCD flicker on: August 11, 2014, 02:22:47 am
Quote
What could it be??
It sounds like a hardware problem.

Try a simple program that prints text to both LCD rows in setup() and does nothing in loop().  Does the text fade in and out ?  If not then move the text printing to loop() and see what happens.

As a matter of interest why are you printing the fixed text over and over again in your original program when only the temperature and humidity change ?
159  Using Arduino / Programming Questions / Re: a little help more like a lot on: August 11, 2014, 01:09:41 am
Quote
rikki/my documents/arduino/libraries/bounce2 that were Bounce2.h is
The folder name and the .h name must match exactly including upper/lowercase
160  Using Arduino / Programming Questions / Re: a little help more like a lot on: August 10, 2014, 04:25:29 pm
Quote
thay are in rikki/my docouments/arduino/libraries/glcd for the glcd
and ipod is in the same place
And the Bounce library ?
161  Using Arduino / Programming Questions / Re: a little help more like a lot on: August 10, 2014, 02:47:52 pm
Which folder are the libraries installed in ?
Note that a normal Arduino installation has 2 libraries folders and I assume that you have put the folders for the libraries in one or other of them, but which ?  What names did you give the folders and what files do they contain ?  Are there any folders in the folders ?
162  Using Arduino / Programming Questions / Re: While Statements: LED's Won't turn off after "if to break" statement???? on: August 10, 2014, 02:14:26 pm
Quote
I'm using a while function because without it, the light only blinks once.  I want it to blink until I press a button.
Then why not use
Code:
while (digitalRead(28) == LOW)
instead of using a variable that never changes to keep the while loop going ?

As a matter of interest have you got pull down resistors on the input pins or are they at a floating voltage when the button is not pressed ?
163  Using Arduino / Programming Questions / Re: While Statements: LED's Won't turn off after "if to break" statement???? on: August 10, 2014, 12:17:09 pm
Quote
I've already tried switching the setting from "LOW" to "HIGH" but there is zero effect on the LEDs.
I think that says it all.  Does the LED flash on/off with a 1 second period when in the function ?

Why is there a while loop in the function ?  As the value of xz is not changed in the loop it is completely unnecessary.

164  Using Arduino / Programming Questions / Re: what is the argument on: August 10, 2014, 10:48:11 am
Quote
In the code shown below, initially there was a delay (wait) towards the bottom of the code
By removing delay(wait); from the function you have also removed the effect of passing any parameter to the function because it is not used.

(uint8_t wait) in the function definition indicates that it is expecting an unsigned 8 bit int as the parameter and that within the function it will be known as wait.  The code will not compile if you do not call the function with anything as the parameter because it is defined as needing one.
165  Using Arduino / Programming Questions / Re: While Statements: LED's Won't turn off after "if to break" statement???? on: August 10, 2014, 10:39:14 am
Quote
I had wanted to use serial.print to troubleshoot a different problem that I ended up fixing, but in unclear what serial print prints too?
It prints to the Serial monitor.  Look for Tools/Serial Monitor in the IDE.

Quote
Correct, that is how the led is connected.
So you really do have a 220K resistor in series with the LED and the LED is basically connected between 5V and the Arduino pin.  I strongly suspect that the resistor is actually 220 ohms, but if that is the case the LED would be on when the Arduino pin goes LOW
Pages: 1 ... 9 10 [11] 12 13 ... 290