Show Posts
Pages: 1 ... 60 61 [62] 63 64 ... 197
916  Using Arduino / Programming Questions / Re: How to write a local function in C++ on: October 13, 2013, 01:38:25 am
That's awesome, thanks Nick.
917  Using Arduino / Programming Questions / Re: Problems for my quad on: October 12, 2013, 03:58:26 am
Could it be because your using delays that block your code from doing anything else until they are done? Maybe look into the Blink Without Delay sketch, and learn how it works.
918  Using Arduino / Project Guidance / Re: Need some advice to build a drag racing tree on: October 12, 2013, 12:39:15 am
I think you forgot to bold this part too i also i'm not sure if i made things clear but we are racing 1/8th scale electric cars (rc)
919  Using Arduino / Audio / Re: Arduino library for WTV020-SD-16P audio module on: October 12, 2013, 12:34:59 am
RL, is that rotate left? I thought it was ROL or RCL (rotate left with carry)
Do you have a complete ASM cheat sheet?

Edited:
Never mind, RL is rotate accumulator left.
920  Using Arduino / Programming Questions / Re: Errors in Programming on: October 11, 2013, 03:02:49 am
Quote
@HazardsMind You are so far ahead of me in terms of skill ! I tested out your code just to see what it would do and all four LEDs would be lit until I touched my computer ! They would turn back on when I lifted my hand. Very interesting. I really wish I understood your functions ( I haven't learned some of those yet).

What functions don't you know? The map() function? all that does is scale down you input to manageable values.

I was using a potentiometer to test the LEDs, so I used the map function to take the values from 0 - 1023 from the pot, and scale them down to 0 - 4 as an manageable output value.  Then I used that value with the aid of a FOR loop, to control which LEDs turn ON or OFF.
921  Using Arduino / Programming Questions / Re: Errors in Programming on: October 10, 2013, 10:11:48 pm
Quote
I mean, the coding lights up an LED, but it doesn't work as intended.
Im guessing the LEDs are not turning off when the temperature goes back down, am I right?

If so, try this. Please note you are needed to fix this to fit to your codes needs.
Code:
int j=0, Pin_num = 0;
const byte pins[4] = { // MY LEDS, YOU NEED TO CHANGE THIS FOR YOUR LEDS.
  2,3,4,13 };

void setup() {
  Serial.begin(9600);

  for(int i = 0; i < 4; i++) {
    pinMode(pins[i],OUTPUT);
  }
}

void loop()
{
  int data = analogRead(A0); // NOT NEEDED FOR YOU
  j = map(data, 0, 1023, 0, 4); // CHANGE THIS, to what PeterH gave you for "ledsOn"
 
  //Serial.println(Pin_num);
  if(Pin_num <= j) {  // This will turn the LEDs on
    for(Pin_num; Pin_num < j; Pin_num++) {
      digitalWrite(pins[Pin_num], HIGH);
    }
  }
  else {
    for(Pin_num; Pin_num >= j; Pin_num--) { // This will likewise, turn them back off.
      digitalWrite(pins[Pin_num], LOW);
    }
  }
}
922  Using Arduino / Programming Questions / Re: Errors in Programming on: October 10, 2013, 08:46:06 pm
@cjdelphi
She was actually, originally she was using pin 1 for her LED1. Its in her earlier post.

Edited.
923  Using Arduino / Project Guidance / Re: Electronically controlled differential on: October 10, 2013, 12:55:21 pm
Well if you know how a regular differential works, then you should be able to simulate it. What happens when you hold one wheel? What happens when neither wheel is touching the ground?

You may want to get an accelerometer, and with some clever coding (mostly IF/ELSE statements) you can simulate a differential.
924  Using Arduino / Programming Questions / Re: Errors in Programming on: October 09, 2013, 11:12:23 pm
Your missing another closing bracket } before your float getVoltage function.
Also your using the serial port, so you might not want to use digital pin 1, for your LEDs. Shift them over and start from pin 2, and update code.

You can also shrink your code if you use the map function and some FOR loops.
925  Using Arduino / Project Guidance / Re: RC Car with RX2 chip and speed regulate. on: October 09, 2013, 12:43:31 pm
Yep.
926  Using Arduino / Project Guidance / Re: Motor only working part of the time on: October 08, 2013, 09:14:38 pm
Do you have any code to show?
927  Using Arduino / Project Guidance / Re: RC Car with RX2 chip and speed regulate. on: October 08, 2013, 08:32:23 pm
You will need a H-bridge, or motor controller. This will do, Motor controller, or you can make your own with some transistors.

To control the speed , you will need to use the analogWrite function and two PWM pins (3,5,6,9,10,11).
928  Using Arduino / Project Guidance / Re: 3 Axis Motorized Camera Slider/Dolly on: October 08, 2013, 03:25:56 pm
try this link here. Arduino mega with LCD + shield

The shield allows you to connect the LCD to the mega/due, it also allows you to have use of your PWM pins.
929  Using Arduino / Project Guidance / Re: Mosfet getting hot and motor vibrating using a 3.6v motor. on: October 08, 2013, 02:15:04 pm
The lower the gate voltage is to what is recommended, 10V, the hotter it gets.
Likewise if the gate is too far over the recommended voltage it will also get hot.
10 volts is the sweet spot.
930  Using Arduino / Project Guidance / Re: Mosfet getting hot and motor vibrating using a 3.6v motor. on: October 08, 2013, 02:07:33 pm
Its getting hot because it is not fully turning on. The gate needs to be at 10 volts to be fully on.
Pages: 1 ... 60 61 [62] 63 64 ... 197