Loading...
  Show Posts
Pages: 1 [2] 3 4 ... 16
16  Using Arduino / Programming Questions / Re: servo (knob) on: April 14, 2013, 11:02:06 am
Quote
some servos can work outside the 0-180 range, which is in reality a pulse range (1000-2000 uS iirc).  when you create your servo, you can redefine max and min pulse length.  push these limits out further till you find the actual limits of your phsyical servo, then put a saftey margin back in to protect it.  If that was confusing I suggest you look online at servo pulse and control signals, since I am bad at explaining this kind of stuff.

the great thing about standards, is everyone can ignore them

so are you on about playing with the 0-180 in the code or (and) the Pulse frequency if so how do I  alter that?


Quote


I got the below pots for tinkering and they seem to work well with the arduino and the price and service is good.

http://www.ebay.com/itm/10pcs-10K-Ohm-B10K-Knurled-Shaft-Linear-Rotary-Taper-Potentiometer-/260985203825?pt=LH_DefaultDomain_0&hash=item3cc3ee2c71

thanks for that smiley


I have got some of these
http://www.firstmarkcontrols.com/s021g.htm
could I use this instead, I have notes it is a 5k though what do you think?
5K will be OK

I did not see anything saying about it being linear??
17  Using Arduino / Programming Questions / Re: servo (knob) on: April 14, 2013, 10:24:23 am
I have got some of these
http://www.firstmarkcontrols.com/s021g.htm
could I use this instead, I have notes it is a 5k though what do you think?
18  Using Arduino / Programming Questions / Re: servo (knob) on: April 14, 2013, 08:03:42 am
that will be it just looked at me pot's and they are all log
so i'll have to get some  linear one's
19  Using Arduino / Programming Questions / Re: servo (knob) on: April 14, 2013, 05:44:24 am
going back to the arduino example code, it does not seem to use the full range of the pot i'm only using about 25% of the pot to move the servo it full travel and the other 75% of the pot does nave all, I have dun a serial read of the analog input from the pot and it uses all 1024 bit's and looks smooth. I have also tried another pot and another servo and tried another power supply all making no effect
any ideas how to over come this? 
20  Using Arduino / Programming Questions / Re: servo (knob) on: April 13, 2013, 03:34:07 pm
thank you all I think I was thinking to hard lol
21  Using Arduino / Programming Questions / servo (knob) on: April 13, 2013, 12:40:26 pm
hi there
I want to be able to control a servo with a pot which is easily done with a sketch provided in examples knob

Quote

// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>

#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
 
int potpin = 0;  // analog pin used to connect the potentiometer
int val;    // variable to read the value from the analog pin
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
  val = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023)
  val = map(val, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  myservo.write(val);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}

what I want to be able to do is add another pot input that will variate the 0 position of the servo between 0 to 10 degrees I have tried a few things but haven't managed to get anywhere any help would be appreciated ?
22  Using Arduino / Displays / Re: utft code issues on: March 27, 2013, 02:26:05 pm
Quote
When you display a screen, set a variable to say that that screen is being displayed. Then whe nyou are checking the buttons, if the variable says screen x, then check for thethe buttons for screen x, if screen y, then the buttons for screen y, etc.

You need to use an if statement to make the selection of which logic to use at the time.

yes ok im struggling to get started, you couldnt give me a kick start in the right direction?
thanks for your help so far



Quote
Arduino 1.03
       i tried mine on 1.0 but couldnt get it to work so i tried it on 2200 and worked fine ever since
23  Using Arduino / Displays / Re: utft code issues on: March 26, 2013, 04:12:52 pm
Quote
you should only check the button depending on which screen is being displayed

how do i go about doing that?
24  Using Arduino / Displays / Re: utft code issues on: March 25, 2013, 01:50:31 pm
yes but they are on two different screens
so in other words main screen will be just a screen to give you general information, then if you tap the screen anywhere it will take you to screen two which will be a menu screen which you can go onto other functions in the future
25  Using Arduino / Displays / Re: utft code issues on: March 24, 2013, 11:37:03 am
ahh yes i see so ive changed my 0 out for the numbers of the coordinates and now my touch is working again but my next issue is now when i tap the screen to go to ScreenTo it goes to it and immediately goes straight back to main screen.
26  Using Arduino / Displays / Re: utft code issues on: March 23, 2013, 12:58:33 pm
int BUTTON1_XMIN = 0;
int BUTTON1_XMAX = 0;
int BUTTON1_YMIN = 0;
int BUTTON1_YMAX = 0;

int BUTTON2_XMIN = 0;
int BUTTON2_XMAX = 0;
int BUTTON2_YMIN = 0;
int BUTTON2_YMAX = 0;


am i getting there lol
it now compiling but the touch does not work?
27  Using Arduino / Displays / Re: utft code issues on: March 22, 2013, 11:44:48 am
Quote
It would be helpful if you could include the actual error message?

yes sorry i should have done


pc_control_x2.cpp: In function 'void loop()':
pc_control_x2:48: error: 'BUTTON1_XMIN' was not declared in this scope
pc_control_x2:48: error: 'BUTTON1_XMAX' was not declared in this scope
pc_control_x2:48: error: 'BUTTON1_YMIN' was not declared in this scope
pc_control_x2:48: error: 'BUTTON1_YMAX' was not declared in this scope
pc_control_x2:53: error: 'BUTTON2_XMIN' was not declared in this scope
pc_control_x2:53: error: 'BUTTON2_XMAX' was not declared in this scope
pc_control_x2:53: error: 'BUTTON2_YMIN' was not declared in this scope
pc_control_x2:53: error: 'BUTTON2_YMAX' was not declared in this scop

i gather the problem is that i have not declared anything?

Quote


What is the variable MainScreen and where is it declared? I would have thought you should be comparing 50, 100, 170, etc to the variables x and y, which contain the coordinates you read form the touchscreen.

yes looks like i got my numbers mixed up
how do i declare it or how do i word it?

yes i do need a biy more practice
28  Using Arduino / General Electronics / Re: power supply on: March 21, 2013, 03:04:57 pm
once again thank you for your input pwillard, no the relay im using is a 24v relay which will handle 40v fine
hence why i needed the two ouput voltages
29  Using Arduino / Displays / Re: utft code issues on: March 21, 2013, 01:24:00 pm
thanks for your exanple
this is all now to me, i have changed that exanple to this:

Code:

 if (myTouch.dataAvailable())
      {
      myTouch.read();
      x=myTouch.getX();
      y=myTouch.getY();
     
      if (50>=MainScreen && 100<= MainScreen && 100>= MainScreen && 170<MainScreen)
      {
         ScreenTo(0, 0, 300, 300);            //
      }

      if (0>=ScreenTo && 0<= ScreenTo && 300>= ScreenTo && 300<=ScreenTo)
      {
        MainScreen(50, 100, 100, 170);   //
      }
    }


 this come's up with errors so i'm doing something obviously wrong??

Quote

Generally, however, you code needs to be reorganised or you will come into trouble. For example, you do not draw the button on the screen, so how does the user know where to press? Once you exit from ScreenTo or Menu, what happens next (maybe this will be completed later?).

yes there is a lot more to be added yet im just trying to understand how this works and how to write things before i get too complicated
30  Using Arduino / General Electronics / Re: power supply on: March 21, 2013, 01:15:54 pm
hi there thank you all for your replys and intrest

pwillard thanks for doing that schematic out of interest what software did you use to do that as it may be worth me upgrading from free hand lol
the transformer im using has an output of 24 volts as docedison said, offload i have seen this transformer sore upto 40V as the voltage regulator does not like this as most only go up to 35v hence why im trying to pick the voltage regulator off the centre tap so i only use 12v obviously that would be more on offload periods.

Docedison also thanks for your reply there are some things on there i might disagree on but some things i also agree on as it sounds like you know what your on about and have some experience on this it would be appreciated if you could do your own schematic as you can form it togehter in your own way to make it easier for us all to understand

many thanks
Pages: 1 [2] 3 4 ... 16