Show Posts
Pages: 1 2 3 [4] 5 6
46  Using Arduino / Displays / Re: LCD menu control of LED’s on: March 31, 2013, 08:07:51 am
Happy to be of help, yes the for was just turning the leds off then on again in a loop giving you a longer delay.
47  Using Arduino / Displays / Re: I2C LCD, first project, need help! on: March 31, 2013, 08:01:01 am
From the datasheet the address is displayed on the screen, so it is 0xC6.

I think you don't need LiquidCrystalI2c, the screen you bought uses i2c but not the same way this library does.
Did you add pullups on the SCL and SDA lines?

Try with the wire library

Code:
void setup() {
  Wire.begin();
  Wire.beginTransmission(0x86); // we're supposed to ditch the 8th bit, the library takes care of it
  Wire.write(1); // set cursor to top left
  Wire.write("Fluttershy rocks");
  Wire.endTransmission();
}
48  Using Arduino / Displays / Re: I2C LCD, first project, need help! on: March 30, 2013, 10:33:56 pm
You sure the I2C address isn't 0xC6 like displayed on the screen?
49  Using Arduino / Displays / Re: Newbie problem: Displaying integer value on Nokia 5110 display on: March 30, 2013, 10:32:16 pm
Hi there, don't use printf

after the call to itoa (p1,buffer,10);
have:
LcdString("decimal: ");
LcdString(buffer); // buffer now contains a string of the value of p1

Then you need other calls to itoa to convert d1 and p2 to string and call LcdString(buffer) to print these strings.

Be careful you can only have 14 characters on a line, looks like you'll overwrite your strings when doing some gotoXY and some string will overlap on the next line.

You almost got it though, keep trying!
50  Using Arduino / Displays / Re: LCD menu control of LED’s on: March 30, 2013, 10:13:05 pm
Hi Pedro, you're almost there, you should define your led patterns and then affect them to your digit variable just before sending the data to the shift register:

Code:
#define pattern1 B11000000
#define pattern2 B00110000
#define pattern3 B00001100
#define pattern4 B00000011
...
void menuUsed(MenuUseEvent used)
{
  if (used.item == "Item1")
    digit=pattern1;
  else if (used.item == "Item2")
    digit=pattern2;
  else if (used.item == "Item3")
    digit=pattern3;
  else
    digit=pattern4;
  for(i = 0; i < 8; i++)
  {
    digitalWrite(latchPin, LOW);                            // Pull latch LOW to start sending data
    shiftOut(dataPin, clockPin, LSBFIRST,digit);         // Send the data
    digitalWrite(latchPin, HIGH);                           // Pull latch HIGH to stop sending data
    delay(200);
    digitalWrite(latchPin, LOW);                            // Pull latch LOW to start sending data
    shiftOut(dataPin, clockPin, LSBFIRST,blank);         // Send the data
    digitalWrite(latchPin, HIGH);                           // Pull latch HIGH to stop sending data

  }
  lcd.setCursor(0,0); 
  lcd.print("PatternDisplayed");
  lcd.setCursor(0,1);
  lcd.print("  Back to Menu");
  delay(2000);  //delay to allow message reading
  lcd.setCursor(0,0); 
  lcd.print("Pedro's Digital  ");
  menu.toRoot();
}


51  Using Arduino / Displays / Re: LCD menu control of LED’s on: March 30, 2013, 08:01:53 am
I was able to see the code, since you can switch on integer only, you'll have to use if and else

Code:
if (used.item==menuItem1) {
// do something
} else if (used.item == menuItem2) {
// do something else
} else if (used.item == menuItem3) {
}...
52  Using Arduino / Displays / Re: LCD menu control of LED’s on: March 29, 2013, 08:31:18 am
Hi Pedro147, it's nice to have someone wanting to learn and not asking others to do the work for them.
The link you provided doesn't work at the moment, so I can't see the code but from what you wrote I guess there are variables somewhere that keep the displayed item number and subitem number, so from these numbers you can use if/else or a switch to trigger the different patterns you want to use.
Something like:
Code:
switch (item) {
  case 1:
    draw (LED1+LED3+LED5);
    break;
  case 2:
    draw (LED2+LED4+LED6);
    break;
  case 3:
    draw (LED1+LED2+LED3);
    break;
  case 4:
    draw (LED4+LED5+LED6);
    break;
}
53  Using Arduino / General Electronics / Re: Pcb power supply on: March 29, 2013, 08:18:37 am
Why would you add another regulator when using Vin?
Just route the power jack to Vin and use a supply that is in the range supported by your arduino model.
54  Using Arduino / Motors, Mechanics, and Power / Re: Unipolar Stepper HELP!! on: March 27, 2013, 09:15:40 am
What's wrong with initializing the stepper library with 7200 steps per revolution? It's an int it should fit.
For 60rpm you'd need 1 rotation per second, that's 7200Hz, it's probably too high.
Do some tests starting low (1 or 2 rpms) and increase slowly until the motor stalls.

55  Using Arduino / Displays / Re: Multiple Nokia LCDs on: March 27, 2013, 08:21:12 am
You seem on the right track.

You could add a parameter to your functions to pass the SCE pin of the screen you want to drive

Code:
void LcdCharacter(char character, byte sce)
{
  LcdWrite(LCD_D, 0x00, sce);
  for (int index = 0; index < 5; index++)
  {
    LcdWrite(LCD_D, ASCII[character - 0x20][index], sce);
  }
  LcdWrite(LCD_D, 0x00, sce);
}

void LcdWrite(byte dc, byte data, byte sce)
{
  digitalWrite(PIN_DC, dc);
  digitalWrite(sce, LOW);
  shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);
  digitalWrite(sce, HIGH);
}

Then call
LcdCharacter('A', PIN_SCE);
or
LcdCharacter('B', PIN_SCE2);
You get the idea.

Yes you have to do exacly that for scrolling, when something goes out of the first screen it must be sent to the next one.
56  Using Arduino / General Electronics / Re: BC337 substitution for MPS2222A? on: March 26, 2013, 01:54:23 pm
I think it will work, try it! You can't break anything with this circuit.
57  Using Arduino / Motors, Mechanics, and Power / Re: Here's a quick stepper "tutorial" with an L293D on: March 26, 2013, 01:49:08 pm
It's quite normal for steppers and drivers to get hot.
A chopper is used to control the maximum current going through a winding when using higher voltage than the motor is supposed to get, usually you can set the current with a trimmer or jumpers.
It's useful because the current will rise faster if using a higher voltage, allowing the motor to step faster. The chopper switches the power on and off to maintain the current to the desired value.
If you don't use a chopper, you need to use the right voltage or you could overheat the motor/driver.
58  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Motor Power Issues on: March 26, 2013, 01:40:03 pm
I thought he meant that there's 24V written on the stepper, I do have old unipolar 24V steppers but modern bipolar ones use much lower voltages, if not using a chopper.
59  Using Arduino / General Electronics / Re: BC337 substitution for MPS2222A? on: March 26, 2013, 06:36:38 am
Depends on the circuit but the 2 transistors are close enough, it should work most of the time.
The pinout is reversed though.
60  Using Arduino / Motors, Mechanics, and Power / Re: Stepper Motor Power Issues on: March 25, 2013, 08:29:20 pm
Are you sure your motor is rated for 24V? that's awfully high for a bipolar stepper.
These types of drivers control the current that flows through the motor winding, whatever the voltage (but don't exceed their max voltage).
You don't need the stepper library when you use a driver with step and dir inputs, just connect two output pins, set the direction and send pulses on the step pin.
Pages: 1 2 3 [4] 5 6