Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Re: Controlling a Stepper Driver on: August 15, 2012, 12:05:31 pm
PM sent.
2  Using Arduino / Programming Questions / Controlling a Stepper Driver on: August 15, 2012, 10:53:24 am
I've searched for hours and can't seem to find a simple way to control the speed and direction of a stepper motor using momentary switches and a potentiometer with Arduino.

I'm using a stepper motor paired to a Sparkfun Easy driver (and appropriate power supply), which requires only step/direction input. 

I want to control the stepper to continuously turn as an electric window in a car.  I want it to go up using a momentary switch and go down using a momentary switch, and use a potentiometer for speed control.

Does anybody have a sample code or list of functions that I can use to incorporate these features.

Send me your email address and I'll "sponsor" your time with $20 USD if you provide a working code.

Thanks!
Steve
3  Using Arduino / Displays / Re: Controlling pins using an LCD display on: September 25, 2011, 08:27:08 am
Running one a number of the examples of the STRLST and get no response from the display.

Thanks,
Steve
4  Using Arduino / Displays / Re: Controlling pins using an LCD display on: September 18, 2011, 08:19:53 am
I found that some guy made an interface for using this display to control LEDs over an aquarium.  I looked in the code, but I dont have enough experience to be able to pick out the particular lines of code I am looking for.  Anybody want to take a look?

http://code.google.com/p/dangerduino/downloads/detail?name=Krusduino_r14.zip&can=2&q=

If anyone knows of a better LCD to use for controlling pins, please let me know, I don't mind buying another one.  Does Liudr's displays allow for the control I am looking for.

Thanks,
Steve
5  Using Arduino / Displays / Controlling pins using an LCD display on: September 13, 2011, 10:46:32 am
I have spend several hours searching, but I cannot find this.  Can someone please point me towards some sample code?  

Here's what I want to do.   I am using a Nokia 3310 shield, see link below.

http://www.nuelectronics.com/estore/index.php?main_page=product_info&products_id=12

I want to be able to have multiple (about 40) menu items on the display, and when I select each menu item, I would like to be able to have other pins on the arduino go HIGH and LOW.  Basically, I'm going to have about 10 LEDs plugged up to the arduino, and want to have different LED combinations turn on based on the menu item.  I don't need any visual feedback on the display, I just need the LEDs to turn on.

Any idea how to get the LCD to let me choose to turn an ouput pin HIGH?

I am using the Arduino Mega 1280

Thanks!
Steve
6  Using Arduino / Programming Questions / Analog to PWM question on: February 11, 2011, 03:38:22 pm
Is it possible to have the PWM level increase in steps, based on a voltage range within 0-10V.
My 0-10V source increases in steps of 0.1V.  Arduino is reading somewhere between the lines, thus, causing almost negligible flickering of my lights which are controlled by the PWM output.  I already have a low pass RC filter, which is a 30K resistor and 4.7uf cap...nevertheless it still has a slight flicker.

For example -
0-0.1V = 1-2 (PWM - 1-2 out of the total 255)
0.1-0.2V = 3-4
ect.

This is what I am using now:
Code:
int val = 0;         // variable to store the read value
   
void setup()  {
  // declare pin 9 to be an output:
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop()  {
 int val = analogRead(0);
val = map(val, 0, 1023, 0, 255);
analogWrite(9, val); 

val = analogRead(1);
val = map(val, 0, 1023, 0, 255);
analogWrite(10, val);

val = analogRead(2);
val = map(val, 0, 1023, 0, 255);
analogWrite(11, val);

val = analogRead(3);
val = map(val, 0, 1023, 0, 255);
analogWrite(3, val);

val = analogRead(4);
val = map(val, 0, 1023, 0, 255);
analogWrite(5, val);

val = analogRead(5);
val = map(val, 0, 1023, 0, 255);
analogWrite(6, val);

}

Thanks!
7  Forum 2005-2010 (read only) / Development / 8 mHz Atmega328 affect PWM frequency? on: January 12, 2011, 03:16:18 pm
Does anyone know off hand if running the 8 mHz (internal oscillator) bootloader affects the PWM frequency?  I read somewhere that the PWM is function or ratio of the overall clock frequency of the chip.


Can anyone confirm or deny this?

Thanks!
Steve
8  Forum 2005-2010 (read only) / Interfacing / Re: Burning Bootloader problem on: October 26, 2010, 05:08:27 pm
I have the FTDI Basic from sparkfun.com , using the serial connection, and I have tried using the Arduino with the ATMega328 chip removed, both with the same error messages.
9  Forum 2005-2010 (read only) / Interfacing / Re: Burning Bootloader problem on: October 25, 2010, 02:56:59 pm
Despite the verified upload, the chip won't upload a program, I get that same exact error....   any ideas?
10  Forum 2005-2010 (read only) / Interfacing / Re: Burning Bootloader problem on: October 24, 2010, 05:26:54 pm
Ok, good tip.

I went ahead and changed the ArduinoISP sketch to:

Code:
#define SCK 52
#define MISO 50
#define MOSI 51
#define RESET 53

This was the only place in the code that I could see the actual pin number references, and I changed them accordingly.

I got a verified upload!

Thanks guys!
11  Forum 2005-2010 (read only) / Interfacing / Burning Bootloader problem on: October 23, 2010, 08:55:15 pm
I am trying to burn a standard arduino bootloader on to a naked ATMega328 chip using Arduino Mega 1280 as ISP, using this guide http://arduino.cc/en/Tutorial/ArduinoToBreadboard .

I have quadruple checked my wiring, despite how simple it is, and have redone it a dozen times.  I have loaded the ArduinoISP successfully onto my Arduino Mega 1280, and get the heartbeat pulse.   For some reason, it just won't burn.  I am using a 16 crystal with caps.

I have also tried using the Arduino Duemilanove as ISP too, with the same error message.

Yes, I selected the correct board (duemilanove), and yes I am clicking on the 'Burn bootloader' option 'w/Arduino as ISP'.

I get the same error messages repeatedly, and suspect it has something to do with the auto-reset.

Code:
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51


I am open to any ideas and suggestions.
Thanks!
12  Forum 2005-2010 (read only) / Interfacing / Re: Voltage to resistance (digital pot or PWM?) on: October 17, 2010, 05:09:00 pm
Richard,
Good idea, I thought I grabbed 10K, but I grabbed 10 ohms, 10Ks work great!  I can't tell you how satisfied I am to see this work!

Taking into account I'm not too familiar with Arduino code, - Regarding the multiple 'ins' and 'outs,' I tried this code, and I get an error at the 'int val'.  Any ideas?

Code:
int ledPin = 9;      // LED connected to digital pin 9
int ledPin = 10;
int ledPin = 11;
int ledPin = 3;
int ledPin = 5;
int ledPin = 6;
int val = 0;         // variable to store the read value
    
void setup()  {
  // declare pin 9 to be an output:
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
}

void loop()  {
 int val = analogRead(0);
val = map(val, 0, 1023, 0, 255);
analogWrite(9, val);  

int val = analogRead(1);
val = map(val, 0, 1023, 0, 255);
analogWrite(10, val);

int val = analogRead(2);
val = map(val, 0, 1023, 0, 255);
analogWrite(11, val);

int val = analogRead(3);
val = map(val, 0, 1023, 0, 255);
analogWrite(3, val);

int val = analogRead(4);
val = map(val, 0, 1023, 0, 255);
analogWrite(5, val);

int val = analogRead(5);
val = map(val, 0, 1023, 0, 255);
analogWrite(6, val);

}

13  Forum 2005-2010 (read only) / Interfacing / Re: Voltage to resistance (digital pot or PWM?) on: October 17, 2010, 04:28:13 pm
The 0-10V source is a regulated lab power supply.  I plugged it up again without the capacitors, turns out it was just a loose wire.  I was using 26 ga wire into the larger female arduino connector and it was jiggling a bit.



Another issue I just ran in to is that the resistors in the voltage divider get hot and start smoking....and they weren't even plugged into arduino yet.  Is there an IC that is a easy fix for a voltage divider, I just need V/2.

Thanks!
Steve
14  Forum 2005-2010 (read only) / Interfacing / Re: Voltage to resistance (digital pot or PWM?) on: October 17, 2010, 03:28:39 pm
Maybe I am getting ahead of myself, but is there a way to have multiple 0-10V inputs with designated outputs? Or can I only initialize one output in?

Example-
A0  interfaces with PWM Pin 3
A1 interfaces with PWM Pin 5
etc...
15  Forum 2005-2010 (read only) / Interfacing / Re: Voltage to resistance (digital pot or PWM?) on: October 17, 2010, 03:18:31 pm
Ok, I have removed the capacitor.  I put it up to the 0-10V source and it is jitterly. When I add the capacitor back on across the 0-10V source, it is perfectly smooth.

If the capacitor does the job, but is not a long term solution, what is a better idea?

Thanks!
Steve
Pages: [1] 2