Shop OBEX P1 Docs P2 Docs Learn Events
sensorColorpal — Parallax Forums

sensorColorpal

I HAVE A PROBLEM WITH THIS SENSOR SOMEONE COULD HELP ME

Comments

  • kwinnkwinn Posts: 8,697
    masalcido wrote: »
    I HAVE A PROBLEM WITH THIS SENSOR SOMEONE COULD HELP ME

    Might be a good idea to show what it is hooked up to, how it is hooked up, what kind of problem you are having, and post the code you are using. My psychic powers are a bit low at the moment.
  • And you don't need to shout. All caps won't get you help any quicker.

    -Phil
  • Here's my code , so i wired up in parallel wiht resistos 2k ti vcc


    #include <SoftwareSerial.h>
    SoftwareSerial Color90(2, 3);
    /*====================================================
    / Connect ColorPAL SIG signal to Arduino pin 2 and 3
    / Baud Rate = 9600 kbps /
    /====================================================*/
    void setup() {
    Serial.begin(9600);
    Color90.begin(4800);
    pinMode(2,INPUT);
    pinMode(3,INPUT);
    digitalWrite(2,HIGH); // Enable the pull-up resistor
    digitalWrite(3,HIGH); // Enable the pull-up resistor
    pinMode(2,OUTPUT);
    pinMode(3,OUTPUT);
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    pinMode(2,INPUT);
    pinMode(3,INPUT);
    Serial.println("Pass 1");
    while( digitalRead(2) != HIGH || digitalRead(3) != HIGH ) {
    Serial.println("In the loop");
    delay(50);
    }
    Serial.println("Pass 2");
    pinMode(2,OUTPUT);
    pinMode(3,OUTPUT);
    digitalWrite(2,LOW);
    digitalWrite(3,LOW);
    delay(80);
    pinMode(2,INPUT);
    pinMode(3,OUTPUT);
    delay(100);
    }

    //

    void loop() {
    char rByte[9];
    Color90.begin(4800); Color90.print("= V !"); delay(500); Color90.print("= R !");
    Color90.print("= $ m !");

    rByte[0] = Color90.read();
    if(rByte[0] == '$'){
    for(int i=0; i < 9; i++){
    rByte = Color90.read();
    Serial.print(rByte);
    }
    Serial.println();
    }
    delay(500);

    }
  • You can not post the same questions in two threads. Please pick one and stick with that thread.
Sign In or Register to comment.