Show Posts
Pages: [1] 2
1  Using Arduino / LEDs and Multiplexing / Re: problem with Using PWM for the LCD backlight on: March 21, 2014, 11:49:55 am
still same problem smiley-sad
2  Using Arduino / LEDs and Multiplexing / Re: problem with Using PWM for the LCD backlight on: March 21, 2014, 05:22:42 am
Yes Paul__B  
Quote
If applying PWM to the backlight - pins 15 and 16 - is causing errors on the LCD, it is obviously a problem with bad connections.
Thats exactly what I'm doing , I tried changing all the wires that I have used but I still get the same problem and  I double checked my connections
I just cant understand  how its working with 255 and not working with any other value !!

does it have anything to do with the transistor im using ? (BS170)
3  Using Arduino / LEDs and Multiplexing / Re: problem with Using PWM for the LCD backlight on: March 20, 2014, 06:59:10 pm
thanks , I dont have a capacitor at the moment . Any other suggestions ?
4  Using Arduino / LEDs and Multiplexing / problem with Using PWM for the LCD backlight on: March 20, 2014, 06:37:28 pm
I'm using digital pin 3 ( which is a PWM pin ) to set the voltage of the back light of the LCD . When I set it to 255 its working fine , but when I change it to something less than 255 for example 127 , The brightness is reduced as excepted but its displaying random characters on the LCD . I really dont know whats going on but I'm pretty sure the connections are correct since that is working when its 255 . I'm already using the BS170 transistor where the Gate is connected to pin 3 , drain is connected to the cathode pin of the ledbacklight and the source is connected to ground and the anode of the  ledbacklight is connected to 5 volts

a video showing what's happening

https://www.dropbox.com/s/1lj2pyxwrkemq7n/2014-03-20%2023.51.13.mp4

Code:
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 2, 4, 5, 6, 7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
      pinMode(3, OUTPUT);

 analogWrite(3,100) ; // when 255 its working fine
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
}
5  Using Arduino / Displays / Re: how to use the 2 lines in the LCD Serial input tutorial on: February 14, 2014, 12:02:05 am
Thanks Don . As I said I tried to use the cursor positioning but I'm not able to get how to do the if condition for that . Like I got the 1st if statement which is 

Code:
if Serial.available() >16 {

// print the 1st 16 in the 1st line starting from lcd.setCursor(0, 0);  and print the rest staring from lcd.setCursor(0, 1)

}


The commented part is the part that I dont know how to write , I would be grateful if u can help me with that
6  Using Arduino / Displays / Re: how to use the 2 lines in the LCD Serial input tutorial on: February 13, 2014, 10:46:17 pm
sorry I meant
Does anyone know how to make it display all the charters in both lines when I type more than 16

Here is the code

Code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
    // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
}

void loop()
{
  // when characters arrive over the serial port...
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
    delay(100);
    // clear the screen
    lcd.clear();
    // read all the available characters
    while (Serial.available() > 0) {
      // display each character to the LCD

     // lcd.setCursor(0, 0); I added this line to see if it can allow me to write in 2 line but it results in only displaying the 1st character i enter I also tried  lcd.setCursor(0,1)

// what im thinking of doing but I dont know how is to say if all column in row one have characters , then continue with the 1st column in row 2
// or if the  no of charecters >8 then print the 1st 8 characters in row one and the rest in row 2 
      lcd.write(Serial.read());
    }
  }
}

the LCD  is a  Hitachi HD44780 compatible LCD  16 by  2 .
I just want to know how to make it write on both lines ( rows ) when the fist line is fully occupied  smiley
7  Using Arduino / Displays / how to use the 2 lines in the LCD Serial input tutorial on: February 13, 2014, 06:49:01 pm
Hello ,

I did this tutorial
http://arduino.cc/en/Tutorial/LiquidCrystalSerial

but the problem is that when I type more than 16 characters  , the LCD  displays the 1st  16 in the 1st line while there is nothing in the 2nd line . I tried using if conditions and setting the courser but that didnt work .

Does anyone know how to make it display all the charters in both lines when I type more than 16 ?    
8  Using Arduino / Programming Questions / Re: problem with using a ps3 controller to light up an led on: June 05, 2013, 05:11:08 pm
no one has idea of what I can do ?
9  Using Arduino / Programming Questions / Re: problem with using a ps3 controller to light up an led on: June 02, 2013, 09:24:46 pm
well this is in the code PS3USB PS3(&Usb);
so it is already there
10  Using Arduino / Programming Questions / problem with using a ps3 controller to light up an led on: June 02, 2013, 02:47:36 pm
Hello , I'm aiming to control a motor by using the ps3 controller . But at the start I just wanted to cheek if I can control an led smiley . So I used the usb host library and modified the program so that when I press the X on the controller the LED should be high . but when I do that nothing happens !!!!

Can some one explain what is going wrong ? I'm a beginner in arduino so I would really appreciate your help
Here is the code
Code:
/*
 Example sketch for the PS3 USB library - developed by Kristian Lauszus
 For more information visit my blog: http://blog.tkjelectronics.dk/ or
 send me an e-mail:  kristianl@tkjelectronics.com
 */

#include <PS3USB.h>
USB Usb;
int led = 13;
/* You can create the instance of the class in two ways */
PS3USB PS3(&Usb); // This will just create the instance
//PS3USB PS3(&Usb,0x00,0x15,0x83,0x3D,0x0A,0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch

boolean printAngle;
uint8_t state = 0;

void setup() {
  Serial.begin(115200);
  pinMode(led, OUTPUT);     
  if (Usb.Init() == -1) {
    Serial.print(F("\r\nOSC did not start"));
    while(1); //halt
  } 
  Serial.print(F("\r\nPS3 USB Library Started"));
}
void loop() {
  Usb.Task();

  if(PS3.PS3Connected || PS3.PS3NavigationConnected) {
    if(PS3.getAnalogHat(LeftHatX) > 137 || PS3.getAnalogHat(LeftHatX) < 117 || PS3.getAnalogHat(LeftHatY) > 137 || PS3.getAnalogHat(LeftHatY) < 117 || PS3.getAnalogHat(RightHatX) > 137 || PS3.getAnalogHat(RightHatX) < 117 || PS3.getAnalogHat(RightHatY) > 137 || PS3.getAnalogHat(RightHatY) < 117) {
      Serial.print(F("\r\nLeftHatX: "));
      Serial.print(PS3.getAnalogHat(LeftHatX));
      Serial.print(F("\tLeftHatY: "));
      Serial.print(PS3.getAnalogHat(LeftHatY));
      if(!PS3.PS3NavigationConnected) {
        Serial.print(F("\tRightHatX: "));
        Serial.print(PS3.getAnalogHat(RightHatX));
        Serial.print(F("\tRightHatY: "));
        Serial.print(PS3.getAnalogHat(RightHatY));
      }
    }
    // Analog button values can be read from almost all buttons
    if(PS3.getAnalogButton(L2) || PS3.getAnalogButton(R2)) {
      Serial.print(F("\r\nL2: "));
      Serial.print(PS3.getAnalogButton(L2));
      if(!PS3.PS3NavigationConnected) {
        Serial.print(F("\tR2: "));
        Serial.print(PS3.getAnalogButton(R2));
      }
    }
    if(PS3.getButtonClick(PS))
      Serial.print(F("\r\nPS"));

    if(PS3.getButtonClick(TRIANGLE))
      Serial.print(F("\r\nTraingle"));
    if(PS3.getButtonClick(CIRCLE))
      Serial.print(F("\r\nCircle"));
    if(PS3.getButtonClick(CROSS))
      digitalWrite(led, HIGH);
    if(PS3.getButtonClick(SQUARE))
      Serial.print(F("\r\nSquare"));

    if(PS3.getButtonClick(UP)) {
      Serial.print(F("\r\nUp"));
      PS3.setAllOff();
      PS3.setLedOn(LED4);
    }
    if(PS3.getButtonClick(RIGHT)) {
      Serial.print(F("\r\nRight"));
      PS3.setAllOff();
      PS3.setLedOn(LED1);         
    }
    if(PS3.getButtonClick(DOWN)) {
      Serial.print(F("\r\nDown"));
      PS3.setAllOff();
      PS3.setLedOn(LED2);         
    }
    if(PS3.getButtonClick(LEFT)) {         
      Serial.print(F("\r\nLeft"));
      PS3.setAllOff();         
      PS3.setLedOn(LED3);         
    }

    if(PS3.getButtonClick(L1))
      Serial.print(F("\r\nL1")); 
    if(PS3.getButtonClick(L3))
      Serial.print(F("\r\nL3"));
    if(PS3.getButtonClick(R1))
      Serial.print(F("\r\nR1")); 
    if(PS3.getButtonClick(R3))
      Serial.print(F("\r\nR3"));

    if(PS3.getButtonClick(SELECT)) {
      Serial.print(F("\r\nSelect - "));
      Serial.print(PS3.getStatusString());       
    }
    if(PS3.getButtonClick(START)) {
      Serial.print(F("\r\nStart"));             
      printAngle = !printAngle;
    }                                               
  }
  if(printAngle) {
    Serial.print(F("\r\nPitch: "));               
    Serial.print(PS3.getAngle(Pitch));                 
    Serial.print(F("\tRoll: "));
    Serial.print(PS3.getAngle(Roll));     
  }
  else if(PS3.PS3MoveConnected) { // One can only set the color of the bulb, set the rumble, set and get the bluetooth address and calibrate the magnetometer via USB
    switch(state) {
    case 0:
      PS3.moveSetRumble(0);   
      PS3.moveSetBulb(Off);     
      state = 1;
      break;

    case 1:
      PS3.moveSetRumble(75);
      PS3.moveSetBulb(Red);     
      state = 2;
      break;

    case 2:
      PS3.moveSetRumble(125);
      PS3.moveSetBulb(Green);     
      state = 3;
      break;

    case 3:
      PS3.moveSetRumble(150);
      PS3.moveSetBulb(Blue);     
      state = 4;
      break;

    case 4:
      PS3.moveSetRumble(175);
      PS3.moveSetBulb(Yellow);   
      state = 5;
      break;

    case 5:
      PS3.moveSetRumble(200);
      PS3.moveSetBulb(Lightblue);   
      state = 6;
      break;

    case 6:
      PS3.moveSetRumble(225);
      PS3.moveSetBulb(Purble);   
      state = 7;
      break;

    case 7:
      PS3.moveSetRumble(250);
      PS3.moveSetBulb(White);   
      state = 0;
      break;
    }
    delay(1000);
  }
}

11  Using Arduino / Networking, Protocols, and Devices / Re: adding a Bluetooth USB Dongle to arduino ADK on: December 01, 2012, 09:32:38 am
I didn't find one . that's why I wrote this post so that if any one has the library could help me with that
many thanks
12  Using Arduino / Networking, Protocols, and Devices / adding a Bluetooth USB Dongle to arduino ADK on: November 29, 2012, 02:20:48 pm
hello ,
I bought a Bluetooth USB Dongle and an arduino ADK board in order to connect my Arduino to my Android galaxy s3 phone . and I'm using an app on the phone which can allow u to control the arduino by your phone and has an option for finding arduino boards with Bluetooth But the problem is my phone is not discovering my board
what code can I use to set up the Bluetooth on the arduino and be able to find it by my phone ?
13  Using Arduino / Project Guidance / Re: how to connect the ps3 controller to an arduino wirelessly ? on: November 25, 2012, 02:46:47 pm
thanks all , but still both links do nox explaim how they connected them smiley-sad
14  Using Arduino / Networking, Protocols, and Devices / Re: how to connect the ps3 controller to an arduino wirelessly ? on: November 25, 2012, 10:01:32 am
I didn't find a store in the UK that seals bluetooth module/shield , so should I buy Arduino Mega ADK ?
15  Using Arduino / Project Guidance / Re: how to connect the ps3 controller to an arduino wirelessly ? on: November 24, 2012, 11:02:03 am
I have a small car which has 2 motors and I'm using 6 buttons to control it . So basically Instead of using my  button controller , I want to use a ps3 controller for it.
 
Pages: [1] 2