Show Posts
Pages: 1 [2] 3 4 ... 6
16  Development / Other Software Development / Re: HBridge Lib on: July 09, 2013, 02:28:03 am
ok manage to get this right but its there a simple command to  statement many var and its functions in one line
now now i now im being now to demand smiley-lol
17  Development / Other Software Development / Re: AVRDude Not supporting Mega2560 (Eclipse Arduino Plugin) on: July 07, 2013, 09:25:07 pm
i was having this problem but cant remember how i get out of this
if i remember correct u can re-install this plugin and the problem will go away or if not u can simply change the MCU val
MCU is the clock of u board if im not mistaken
18  Development / Other Software Development / Re: HBridge Lib on: July 07, 2013, 09:20:51 pm
u see that's the funny part this val
Code:
int EA[] = {EA1, EA2, EA3, EA4, EA5};
int EB[] = {EB1, EB2, EB3, EB4, EB5};
int I1[] = {I11, I12, I13, I14, I15};
int I2[] = {I21, I22, I23, I24, I25};
int I3[] = {I31, I32, I33, I34, I35};
int I4[] = {I41, I42, I43, I44, I45};
will be define by  end user, this is the declaration of my (users) arduino output ports connected to a single or multiple H-Bridges in my case its only 5 (for now)
or can i rewrite this for something less complicated ?
i re-declared this statement 'HBridge::HBridge(int)' like u say to include the EA EB I1 I2 I3 I4 but im getting still this error "error: invalid conversion from 'int' to 'int*'" can it be that i but to many variables to one statement. this HBridge::HBridge(int hbnum) should only be active if theirs more then one H-Bridges decelerated
19  Development / Other Software Development / Re: Rotary Encoder Library on: July 06, 2013, 01:17:55 am
yes like my i was looking for something like this small and easy to use
i want to connect a I2C and read a couples of this encoder  
20  Development / Other Software Development / HBridge Lib on: July 06, 2013, 01:07:57 am
hey guys today i had i idea to make a universal lib for arduino and have some question for you
so lets start heres my code
HBridge.cpp
Code:
#include "HBridge.h"
#include "HBridge.h"

int EA[] = {EA1, EA2, EA3, EA4, EA5};
int EB[] = {EB1, EB2, EB3, EB4, EB5};
int I1[] = {I11, I12, I13, I14, I15};
int I2[] = {I21, I22, I23, I24, I25};
int I3[] = {I31, I32, I33, I34, I35};
int I4[] = {I41, I42, I43, I44, I45};

/*

*/
HBridge::HBridge(int hbnum)
{
_hbnum = hbnum;
switch(hbnum)
{
case 1:
setEnablePins(EA1, EB1);
setControlPins(I11, I21, I31, I41);
break;
case 2:
setEnaplePins(EA2, EB2);
setControlPins(I12, I22, I32, I42);
break;
case 3:
setEnablePins(EA3, EB3);
setControlPins(I13, I23, I33, I43);
break;
case 4:
setEnablePins(EA4, EB4);
setContrloPins(I14, I24, I34, I44);
break;
case 5:
setEnablePins(EA5, EB5);
setControlPins(I15, I25, I35, I45);
}
}

/*

*/
HBridge::setEnablePins(int EA[], int EB[])
{
_EA[] = EA[];
_EB[] = EB[];
pinMode(_EA[], OUTPUT);
pinMode(_EB[], OUTPUT);
}

/*

*/
HBridge::setControlPins(int I1[], int I2[], int I3[], int I4[])
{
_I1[] = I1[];
_I2[] = I2[];
_I3[] = I3[];
_I4[] = I4[];
pinMode(_I1[], OUTPUT);
pinMode(_I2[], OUTPUT);
pinMode(_I3[], OUTPUT);
pinMode(_I4[], OUTPUT);
}

HBridge.h
Code:

#include "Arduino.h"

#ifndef HBridge_h
#define HBridge_h


#if ARDUINO >= 100
    #include "Arduino.h"
#else    
    #include "WProgram.h"
#endif

class HBridge {

public:

    HBridge(int hbnum, int EA[], int EB[], int I1[], int I2[], int I3[], int I4[]);

    void setEnablePins(int EB[], int EB[]);
    void setControlPins(int I1[], int I2[], int I3[], int I4[]);
    void setHBridge(int hbnum);

private:
int _hbnum;

};

#endif


hers a simply code that i have now a problem
Code:
#include <HBridge.h>

HBridge hb1(1);

void setup() {

    // initialize bot pins
    hb1.setEnablePins(3, 5);
    hb1.setControlPins(2, 4, 7, 8);
}

void loop() {
}
and im getting this error
Code:
\libraries\HBridge/HBridge.h:24: error: multiple parameters named 'EB'
sketch_jul06a:18: error: no matching function for call to 'HBridge::HBridge(int)'
 \libraries\HBridge/HBridge.h:22: note: candidates are: HBridge::HBridge(int, int*, int*, int*, int*, int*, int*)
 \libraries\HBridge/HBridge.h:18: note:                 HBridge::HBridge(const HBridge&)
sketch_jul06a.ino: In function 'void setup()':
sketch_jul06a:23: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:23: error: initializing argument 1 of 'void HBridge::setEnablePins(int*, int*)'
sketch_jul06a:23: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:23: error: initializing argument 2 of 'void HBridge::setEnablePins(int*, int*)'
sketch_jul06a:24: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:24: error: initializing argument 1 of 'void HBridge::setControlPins(int*, int*, int*, int*)'
sketch_jul06a:24: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:24: error: initializing argument 2 of 'void HBridge::setControlPins(int*, int*, int*, int*)'
sketch_jul06a:24: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:24: error: initializing argument 3 of 'void HBridge::setControlPins(int*, int*, int*, int*)'
sketch_jul06a:24: error: invalid conversion from 'int' to 'int*'
sketch_jul06a:24: error: initializing argument 4 of 'void HBridge::setControlPins(int*, int*, int*, int*)'

i dont now if um using this right int EA[] = {EA1, EA2, EA3, EA4, EA5};
and this HBridge::HBridge(int hbnum) can some one advice?
for now its simply but i what to include both enable A and B for one bridge to control and many more
but first lets concentrate on this :]
21  Using Arduino / Motors, Mechanics, and Power / Arduino Uniwersal HBridge libery on: July 03, 2013, 11:53:40 am
hey guys today i had i idea to make a universal lib for arduino and have some question for you
so lets start heres my code
HBridge.cpp
Code:
#include "HBridge.h"

int EA[] = {EA1, EA2, EA3, EA4, EA5};
int EB[] = {EB1, EB2, EB3, EB4, EB5};
int I1[] = {I11, I12, I13, I14, I15};
int I2[] = {I21, I22, I23, I24, I25};
int I3[] = {I31, I32, I33, I34, I35};
int I4[] = {I41, I42, I43, I44, I45};

/*

*/
HBridge::HBridge(int hbnum)
{
switch(hbnum)
{
case 1:
setEnablePins(EA1, EB1);
setControlPins(I11, I21, I31, I41);
break;
case 2:
setEnaplePins(EA2, EB2);
setControlPins(I12, I22, I32, I42);
break;
case 3:
setEnablePins(EA3, EB3);
setControlPins(I13, I23, I33, I43);
break;
case 4:
setEnablePins(EA4, EB4);
setContrloPins(I14, I24, I34, I44);
break;
case 5:
setEnablePins(EA5, EB5);
setControlPins(I15, I25, I35, I45);
}
}

/*

*/
setHBridge::setEnablePins(uint8_t EA[], uint8_t EB[])
{ pinMode(EA[], OUTPUT);
pinMode(EB[], OUTPUT);
}

/*

*/
HBridge::setControlPins(uint8_ I1[], uint8_t I2[], uint8_t I3[], uint8_t I4[])
{
pinMode(I1[], OUTPUT);
pinMode(I2[], OUTPUT);
pinMode(I3[], OUTPUT);
pinMode(I4[], OUTPUT);
}
HBridge.h
Code:

#ifndef HBridge
#define HBridge


#if ARDUINO >= 100
    #include "Arduino.h"
#else   
    #include "WProgram.h"
#endif

class HBridge {

public:

    HBridge(int hbnum, uint8_t EA[], uint8_t EB[], uint8_t I1[], uint8_t I2[], uint8_t I3[], uint8_t I4[]);

    void setEnablePins(uint8_t EB[], uint8_t EB[]);
    void setControlPins(uint8_t I1[], uint8_t I2[], uint8_t I3[], uint8_t I4[]);
    void setHBridge(int hbnum);

private:
int hbnum;

};

#endif
i dont now if um using this right int EA[] = {EA1, EA2, EA3, EA4, EA5};
and this HBridge::HBridge(int hbnum) can some one advice
for now its simply but i what to include both enable A and B for one bridge to control and many more
but firs lets concentrate on this :]
22  Using Arduino / Displays / Re: LCD I2C backlight problem on: June 24, 2013, 08:27:54 am
well i go liltel bit furtherer and change the few val of LIquidCrystal_I2C.cpp
orginall:
Code:
// Turn the (optional) backlight off/on
void LiquidCrystal_I2C::noBacklight(void) {
_backlightval=LCD_NOBACKLIGHT;
expanderWrite(0);
}

void LiquidCrystal_I2C::backlight(void) {
_backlightval=LCD_BACKLIGHT;
expanderWrite(0);
}
after i change it
Code:
// Turn the (optional) backlight off/on
void LiquidCrystal_I2C::backlight(void) {
_backlightval=LCD_NOBACKLIGHT;
expanderWrite(0);
}

void LiquidCrystal_I2C::noBacklight(void) {
_backlightval=LCD_BACKLIGHT;
expanderWrite(0);
}

now when u put :
Code:
lcd.baclight();
or
Code:
lcd.setBacklight(HIGH);
u get on PCF8574A/P/AP the IO pin12 OUTPUT to high
23  Using Arduino / Displays / Re: LCD I2C backlight problem on: June 24, 2013, 07:41:46 am
ok never mind found the solution in this thread
http://forum.arduino.cc/index.php?topic=96747.0
i just make somthing like that
Code:
lcd.setBacklight(LOW);
24  Using Arduino / Displays / Re: LCD I2C backlight problem on: June 24, 2013, 07:32:22 am
yes the hardware its ok but now we i need to look into the code
like i first mention i try the 2 different code setup with this
Code:
lcd.setBacklight();
and
Code:
lcd.backlight();
and the problem is still or do im doing something wrong?
25  Using Arduino / Displays / Re: LCD I2C backlight problem on: June 24, 2013, 06:19:51 am
im using a lib thats called LiquidCrystal_I2C to communicate with my LCD
i have measured the IO of the I2C  pin and the voltage its not rising its HIGH (3,45V) for a 1 second and then LOW (0,0V)
the voltage on transistor emitter is 4,95V and on collector is 0,45V and when base has 0V so i assume its correct 
26  Using Arduino / Displays / Re: LCD I2C backlight problem on: June 24, 2013, 04:54:07 am
if i connect the back light to resistor and +5V its working
after initialization the pin 12 OUTPUT on PCF8574AP are in LOW state
after i reset or restart arduino the backlight are on for a few seconds and they switch off and my data are pooping on my LCD
27  Using Arduino / Displays / LCD I2C backlight problem on: June 24, 2013, 03:32:28 am
hey all im using a PCF8574AP I2C with a standard LCD 20x4 and have some problem with back light 
i try different settings in code

Code:
lcd.setBacklight(HIGH);

and

Code:
lcd.backlight();

put the problem is that after i put voltage or connect my device to arduino it initialization the back light its turning off 
i have thought that i make some error connecting a transistor but its still the same

i connect the transistor following:
1.Emitter to +5 Voltage
2.Base to I2C pin 12 with a 1k resistor
3.Collector to my LCD pin 15 with a 50 ohm resistor and a test led connected parallel with a 4,7k resistor

have no ideas how to make that work please advice



28  Using Arduino / Microcontrollers / Arduino Uno and a difrent controller on: May 11, 2013, 05:35:18 am
hey guys im interested if its possible to change the stock controller in Uno to a different Atmega328P-PU chip?
i notice that the orginal have ATMEGA328P-PU 1305 chip but i cant find any info regarding this specifying chip
i try to replace it with a different Atmega chip but nothing happen (i get message that the controller was not in sync) its that even possible or i need the exact same chip

Best regards Mike
29  Using Arduino / Motors, Mechanics, and Power / Re: how use motor shield ? on: March 21, 2013, 01:10:15 pm
in this
void loop()
{
  analogWrite(motorM1, 512);  // R├ęsultat d'analogRead entre 0 to 1023
}
 try a val from 0 to 255

and what for motor controller your using
30  Using Arduino / Motors, Mechanics, and Power / Re: DC Motor and Potentiometer positioning on: March 10, 2013, 12:45:36 pm
my minval is 10 and my maxval 1000 thats because i don't want damage the potentiometer so im using this as a stop point
it seems to me as hes in loop with this part
Code:
             if ((val1>val2)&&(val1>minval))
{
Motor_1_3();
}
if ((val1<val2)&&(val1<maxval))
{
Motor_2_4();
}
Pages: 1 [2] 3 4 ... 6