Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 289
106  Using Arduino / Programming Questions / Re: Issue with a very simple library on: August 18, 2014, 04:45:15 am
Quote
my library is called Sim908.
It is in folder
/libraries/Sim908/
Which folder is the libraries folder in ?
107  Using Arduino / Programming Questions / Re: Solved : count pulses with timer1 or timer2 on: August 18, 2014, 04:24:06 am
Code:
   delay(tiempo); // Sin esto no funciona
Can you explain what this is for as the comment says that it does not work ?
108  Using Arduino / Programming Questions / Re: Code Error on: August 18, 2014, 02:38:26 am
Does the term EthernetClient appear anywhere in the code ?
Seeing the full error message would be more helpful ?
109  Using Arduino / Programming Questions / Re: OrangeRX used for sending data files on: August 17, 2014, 04:22:01 am
Is the Orange device that you provided a picture of a transmitter or a receiver ?
I am familiar with Orange RC receivers and you can get Orange modules to fit in FrSky transmitters.  Can you provide a link to the device pictured ?
110  Using Arduino / Programming Questions / Re: count pulses with timer1 or timer2 on: August 17, 2014, 03:00:13 am
You are generating the pulses so you can count them by incrementing a variable as each one is produced.
As to the time taken to produce 300 pulses, save micros() before you start generating the pulses and save it again when the pulse counter reaches 300.  Take the start value from the end value and that is the elapsed time.

This sounds dreadfully simple.  Post your current program here for more help.
111  Using Arduino / Programming Questions / Re: Function dtostrf() on: August 17, 2014, 01:34:48 am
I do not understand the Function dtostrf () Please explain.
What is it that you do not understand ?  Have you tried to use it and got unexpected results ?
112  Using Arduino / Programming Questions / Re: skaarhoj ATEM arduino Control Code on: August 16, 2014, 12:25:24 pm
I know nothing about the library that you are using or how it works, but this
Code:
AtemSwitcher.delay(5000);
looks very much like it waits for 5 seconds during which time it will not respond to any input.  If that is the case then no wonder
Quote
sometimes it takes a few seconds to respond, sometime it is instant.

What is the delay there for ?
113  Using Arduino / Programming Questions / Re: Push Buttons not working as expected to toggle RGB LED on and off. on: August 16, 2014, 05:19:43 am
Code:
    if (purpleCounter % 2 == 0) {
      setColor(255,0,255);
Code:
    if (redCounter % 2 == 0) {
      setColor(255,0,255);
Both of these can't be true because they use the same output values for two different colours.
114  Using Arduino / Programming Questions / Re: PC Shutdown/Startup controller on: August 15, 2014, 11:29:38 am
Put it in the loop() function.  You said that you intended to keep the Arduino running, which may not be a great idea due to battery drain.  If the Arduino is not to be kept running then I don't see the need for it anyway.  Just use a toggle switch to power the PC on/off.  Either way, how are you going to deal with shutting down the PC nicely rather than simply turning it off when commanded ?
115  Using Arduino / Programming Questions / Re: a little help more like a lot on: August 15, 2014, 11:23:57 am
Quote
iPodInfoSystem_v03_redo:154: error: 'class AdvancedRemote' has no member named 'setup'
Have you got any examples of code using AdvancedRemote.setup() ?  If not then why do you believe that it exists and should be used ?  There is no setup() function in AdvancedRemote.h so it is no surprise that your program will not compile.

It is possible that more than one version of the library exists or that there are two or more different libraries with the same name.
116  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 15, 2014, 08:30:51 am
Quote
I am just trying to get this first slider to work and know that it is working correctly then I was thinking about adding another two sliders for the RGB.
If that is the case then I would strongly advise that you proceed each of the individual RGB values with an identifier so that on the Arduino you can spilt the serial input and adjust the appropriate R, G or B value.  So, the Arduino logic becomes
Code:
if serial input is available
  read a byte
  if the byte is R, G or B
    read the next byte when it is available
    call a function to adjust R, G or B output passing the colour identifier and byte value as parameters
  end if
end if
Using that logic will allow you to send the R, G or B value only when it changes and for the Arduino to react to the changes.  That way the serial traffic is much reduced compared with constantly sending the 3 values and the colour identifier allows the Arduino to get back in step if some serial data is missed or corrupted.

In your test code
Code:
    *int red = Serial.parseInt();
    int green = Serial.parseInt();
    int blue = Serial.parseInt();
why is the red value a pointer and the green and blue ones not ?
117  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 15, 2014, 06:51:19 am
Quote
Is this sending the textbox values (0-255) to the arduino, the Rx light is certainly flashing.
I don't know enough about VS to give advice on this.  To start with how about just sending a byte with a fixed value to the serial port from VS rather than the value from the slider ?  That way you know what you are sending and, therefore, what you expect to receive.

Quote
Is this the correct way of doing this, reading as an integer? Or should it be as Byte, Char etc.
Serial data arrives one byte at a time so that is what you need to read. 

Code:
if(sliderVal >= '0' && sliderVal < '11')
This will not work because you are receiving bytes but testing for chars.

Write a program to wait until there is serial data available then read a byte and print it. If you follow my suggestion to send a known value then you will know if what you are getting is correct.  Next step, send a series of known values, receive them and print them.  Now you know that what you are sending is what you are receiving.  Next step, send the slider value, receive it and only print it when it changes (or only send it when it changes). 

Come back and post the Arduino code when you have got that working. 

In the meantime can you describe what the relationship should be between the slider value received and the RGB value or are there going to be 3 sliders in VS, one each for R, G and B ?
118  Using Arduino / Programming Questions / Re: Controlling LED's with Trackbar in VS on: August 15, 2014, 04:49:19 am
Quote
I need to be able to read a byte then start fading. Read second byte from slider and start fading again and keep doing this until the slider is all the way to ten.
I don't get this.  Please can you describe the actions that will be taken on the PC and the result you want to achieve on the Arduino as a result of the actions ?

Quote
Is this sending ten bytes i.e: A byte for each tick on the slider?
I don't know, but I still think that all you need to send is TrackBar1.Value..  Then on the Arduino read the incoming value when Serial data is available and call a function to set the RGB values appropriately for the value received, assuming that the slider position is to control the RGB output.  However, once you describe what you want to happen more advice can be given.
119  Using Arduino / Programming Questions / Re: How to display on serial monitor? (Questions and Answer Input) on: August 15, 2014, 02:44:29 am
Code:
   int qNumber = Serial.read()// code to get a question number and save it in qNumber
   if (qNumber == '0')// put 0 in qNumber if there is no response or an invalid number
Both lines are missing the terminating semi-colon

Code:
      case 2:
           questionB();
           break;
There is no questionB() function in the program

Code:
  correctAnswer = '';
The correctAnswer variable is not declared in the program.
120  Using Arduino / Programming Questions / Re: PC Shutdown/Startup controller on: August 15, 2014, 01:40:47 am
Quote
I don't want the script to loop because it would just keep pulsing the header.
Have the code controlled by if statements.
Code:
if pcRunning is false
  code to read car ignition voltage and start the PC if the ignition is on
  set pcRunning to true
end if
else
  code to read car ignition voltage and stop the PC if the ignition is off
  set pcRunning to false
end else
A car is a pretty rough electrical environment so it may not be simple to get this working.
Pages: 1 ... 6 7 [8] 9 10 ... 289