Show Posts
Pages: [1] 2 3 ... 7
1  Using Arduino / Networking, Protocols, and Devices / Re: XBee data with random -38 and -35 values on: May 09, 2014, 08:23:16 pm
Thanks for the replies.  After the first response by michinyon, I took out the ln part of the Serial.println, and it worked great, but of course since the data was not separated by anything at all, (0 and 6 would come out as 606060606060 which could be interpreted as 6, and 0, or 0, and 6), I added in something to show what data was what.  I added in a '~' before one of the values, and none of the values excede single digits, so then you could tell which piece of data was what.  Although, there is occasionally an extra '678' somewhere in there which is throwing the bot off.  This then makes the robot less smooth at moving, stuttering a lot, which will eventually burn out the motors.  I am looking to make the FuzzBot move more smoothly (somewhere in the code), any ideas?

I have adjusted the code again, and here is the new code for the Bots:

Code:
/*  MFBA '14 Bot (NeoPixel Controller)

  Uses FuzzBot + mount with XBee and LED's, received by the Neo-
  Pixel controller board.
 
  created 5.4.14
  made by Quin Etnyre
 
  kudos to Bildr, Adafruit

*/

#include <ZumoMotors.h>

ZumoMotors motors;

int turnVal;
int potVal;

int lastTurnVal;
int thirdVal;
int fourthVal;

void setup() {
 
  Serial.begin(9600);
}

void loop() {
 
  while(Serial.available()) {
    if(Serial.read() == '~') {
     int turnVal = Serial.read() - '0';
     int potVal = Serial.read() - '0';
   
   Serial.print(turnVal);
   Serial.println(potVal);
 
  int speedVal = map(potVal, 0, 9, 0, 25);
 
  switch (turnVal) {
    case 1:
    if(lastTurnVal == 1) {
      if(thirdVal == 1) {
        if(fourthVal == 1) {
        break;
        }
      }
    }
      motors.setLeftSpeed(speedVal);
      motors.setRightSpeed(9*speedVal);
      break;
    case 2:
    if(lastTurnVal == 2) {
      if(thirdVal == 2) {
        if(fourthVal == 2) {
        break;
        }
      }
    }
      motors.setLeftSpeed(2*speedVal);
      motors.setRightSpeed(8*speedVal);
      break;
    case 3:
    if(lastTurnVal == 3) {
      if(thirdVal == 3) {
        if(fourthVal == 3) {
        break;
        }
      }
    }
      motors.setLeftSpeed(3*speedVal);
      motors.setRightSpeed(7*speedVal);
      break;
    case 4:
    if(lastTurnVal == 4) {
      if(thirdVal == 4) {
        if(fourthVal == 4) {
        break;
        }
      }
    }
      motors.setLeftSpeed(4*speedVal);
      motors.setRightSpeed(6*speedVal);
      break;
    case 5:
    if(lastTurnVal == 5) {
      if(thirdVal == 5) {
        if(fourthVal == 5) {
        break;
        }
      }
    }
      motors.setLeftSpeed(5*speedVal);
      motors.setRightSpeed(5*speedVal);
      break;
    case 6:
    if(lastTurnVal == 6) {
      if(thirdVal == 6) {
        if(fourthVal == 6) {
        break;
        }
      }
    }
      motors.setLeftSpeed(6*speedVal);
      motors.setRightSpeed(4*speedVal);
      break;
    case 7:
    if(lastTurnVal == 7) {
      if(thirdVal == 7) {
        if(fourthVal == 7) {
        break;
        }
      }
    }
      motors.setLeftSpeed(7*speedVal);
      motors.setRightSpeed(3*speedVal);
      break;
    case 8:
    if(lastTurnVal == 8) {
      if(thirdVal == 8) {
        if(fourthVal == 8) {
        break;
        }
      }
    }
      motors.setLeftSpeed(8*speedVal);
      motors.setRightSpeed(2*speedVal);
      break;
    case 9:
    if(lastTurnVal == 9) {
      if(thirdVal == 9) {
        if(fourthVal == 9) {
        break;
        }
      }
    }
      motors.setLeftSpeed(9*speedVal);
      motors.setRightSpeed(speedVal);
      break;
      }
     
      thirdVal = lastTurnVal;
      lastTurnVal = turnVal;
     
     
    }
  }
}

And here is the newest controller code:

Code:
/* MFBA Controller
   
   Using NeoPixel Ring (14) x2, rotary encoder (SFE, R/G),
   slider pot (sm/med).
   
   created 5.4.14
   made by Quin Etnyre
   
   kudos to Bildr, Adafruit
*/

#include <Adafruit_NeoPixel.h>
#include <SoftwareSerial.h>
 
#define PIN 4 // NeoPixel Pin #
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(16, PIN); //x16

uint32_t color  = 0xFFA500; // Start 'Qtechknow' Green

//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;

volatile int lastEncoded = 0;
volatile long encoderValue = 0;

long lastencoderValue = 0;

int lastMSB = 0;
int lastLSB = 0;

SoftwareSerial Serial7Segment(7, 8); //RX pin, TX pin
int cycles = 0;
int runClock = HIGH;
int i = 3000;

int sensorValue;  // integer for potentiometer

void setup() {
  Serial.begin (9600);
 
  Serial7Segment.begin(9600); //Talk to the Serial7Segment at 9600 bps
  Serial7Segment.write('v'); //Reset the display - this forces the cursor to return to the beginning of the display

  pinMode(encoderPin1, INPUT);
  pinMode(encoderPin2, INPUT);

  digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
  digitalWrite(encoderPin2, HIGH); //turn pullup resistor on

  //call updateEncoder() when any high/low changed seen
  //on interrupt 0 (pin 2), or interrupt 1 (pin 3)
  attachInterrupt(0, updateEncoder, CHANGE);
  attachInterrupt(1, updateEncoder, CHANGE);
 
  pixels.begin();
  pixels.setBrightness(60); // 1/3 brightness
}

void loop(){
 
  sensorValue=analogRead(0); // slider pot
 
  int newValue = abs(encoderValue);

  int finalValue = map(newValue, 300, 0, 0, 15);
 
  pixels.setPixelColor(finalValue-1, 0);
  pixels.setPixelColor(finalValue+3, 0);
 
  pixels.setPixelColor(finalValue, color);
  pixels.setPixelColor(finalValue+1, color);
  pixels.setPixelColor(finalValue+2, color);
  pixels.show();
 
  int printVal = map(newValue, 0, 300, 0, 9);
  int printPot = map(sensorValue, 0, 1023, 0, 9);

  Serial.write(0x7E);
  Serial.print(printVal);
  Serial.print(printPot);
}


void updateEncoder(){
  int MSB = digitalRead(encoderPin1); //MSB = most significant bit
  int LSB = digitalRead(encoderPin2); //LSB = least significant bit

  int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
  int sum  = (lastEncoded << 2) | encoded; //adding it to the previous encoded value

  if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
  if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;

  lastEncoded = encoded; //store this value for next time
}

And here is the data I'm getting from the bot's side after I try and decode the data:

Code:
46
46
46
46
678
46
678
46
678
46
678
46
678
46
678
46
678
46
46
46
46
46

Thanks,
Quin
2  Using Arduino / Networking, Protocols, and Devices / Serial.flush() not supported, other options? on: May 07, 2014, 09:41:34 pm
Hi all,

I am working on a project for Maker Faire this year as part of the Atmel booth, this part is basically a controller that controls a robot.  One side has a rotary encoder with an XBee, NeoPixel ring, and the other is an XBee plus a ZumoBot (Pololu).  XBee settings are correct, Series 1 directly to one another.  I have successfully coded the Rotary encoder, NeoPixel ring, and FuzzBot, with the data sent via XBee being mapped (with the map() function) from 0-9, so it is a two-digit repeating data stream that the XBee should be receiving.

However, when I use a Serial Echo program (prints whatever it's receiving basically, with no complex functions at all), the numbers come out fine, so the problem isn't in the XBees is my understanding.   I followed an XBee tutorial from Jeremy Blum, but the video said he was using a pre Arduino 1.0 version of the software.  The part of the code:  Serial.read() - '0'; he said was to convert the data into an integer, but I thought that was what I was doing before.  Then, I saw that he had Serial.flush() at the end of his code (which is not supported in 1.0), and I think that is where the problems are in the code.

Any help?

Thanks,
q

The code below is for the Bot:

Code:
/*  MFBA '14 Bot (NeoPixel Controller)

  Uses FuzzBot + mount with XBee and LED's, received by the Neo-
  Pixel controller board.
 
  created 5.4.14
  made by Quin Etnyre
 
  kudos to Bildr, Adafruit

*/

#include <ZumoMotors.h>

ZumoMotors motors;

int turnVal;
int potVal;

void setup() {
 
  Serial.begin(9600);
}

void loop() {
 
  while(Serial.available() == 0);
   int turnVal = Serial.read() - '0';
   int potVal = Serial.read() - '0';
   
   Serial.print(turnVal);
   Serial.println(potVal);
 
  int speedVal = map(potVal, 0, 9, 0, 5);
 
  switch (turnVal) {
    case 1:
      motors.setLeftSpeed(9*speedVal);
      motors.setRightSpeed(speedVal);
      Serial.println("1");
      delay(2);
      break;
    case 2:
      motors.setLeftSpeed(8*speedVal);
      motors.setRightSpeed(2*speedVal);
      delay(2);
      break;
    case 3:
      motors.setLeftSpeed(7*speedVal);
      motors.setRightSpeed(3*speedVal);
      delay(2);
      break;
    case 4:
      motors.setLeftSpeed(6*speedVal);
      motors.setRightSpeed(4*speedVal);
      delay(2);
      break;
    case 5:
      motors.setLeftSpeed(5*speedVal);
      motors.setRightSpeed(5*speedVal);
      delay(2);
      break;
    case 6:
      motors.setLeftSpeed(4*speedVal);
      motors.setRightSpeed(6*speedVal);
      delay(2);
      break;
    case 7:
      motors.setLeftSpeed(3*speedVal);
      motors.setRightSpeed(7*speedVal);
      delay(2);
      break;
    case 8:
      motors.setLeftSpeed(2*speedVal);
      motors.setRightSpeed(8*speedVal);
      delay(2);
      break;
    case 9:
      motors.setLeftSpeed(speedVal);
      motors.setRightSpeed(9*speedVal);
      delay(2);
      break;

  }
}

The code below is for the controller:

Code:
/* MFBA Controller
   
   Using NeoPixel Ring (14) x2, rotary encoder (SFE, R/G),
   slider pot (sm/med).
   
   created 5.4.14
   made by Quin Etnyre
   
   kudos to Bildr, Adafruit
*/

#include <Adafruit_NeoPixel.h>
 
#define PIN 4 // NeoPixel Pin #
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(16, PIN); //x16

uint32_t color  = 0xFFA500; // Start 'Qtechknow' Green

//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;

volatile int lastEncoded = 0;
volatile long encoderValue = 0;

long lastencoderValue = 0;

int lastMSB = 0;
int lastLSB = 0;

int sensorValue;  // integer for potentiometer

void setup() {
  Serial.begin (9600);

  pinMode(encoderPin1, INPUT);
  pinMode(encoderPin2, INPUT);

  digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
  digitalWrite(encoderPin2, HIGH); //turn pullup resistor on

  //call updateEncoder() when any high/low changed seen
  //on interrupt 0 (pin 2), or interrupt 1 (pin 3)
  attachInterrupt(0, updateEncoder, CHANGE);
  attachInterrupt(1, updateEncoder, CHANGE);
 
  pixels.begin();
  pixels.setBrightness(60); // 1/3 brightness
}

void loop(){
 
  sensorValue=analogRead(0); // slider pot
 
  int newValue = abs(encoderValue);

  int finalValue = map(newValue, 300, 0, 0, 15);
 
  pixels.setPixelColor(finalValue-1, 0);
  pixels.setPixelColor(finalValue+3, 0);
 
  pixels.setPixelColor(finalValue, color);
  pixels.setPixelColor(finalValue+1, color);
  pixels.setPixelColor(finalValue+2, color);
  pixels.show();
 
  int printVal = map(finalValue, 15, 0, 0, 9);
  int printPot = map(sensorValue, 0, 1023, 0, 9);

  Serial.print(printVal);
  Serial.println(printPot);
}


void updateEncoder(){
  int MSB = digitalRead(encoderPin1); //MSB = most significant bit
  int LSB = digitalRead(encoderPin2); //LSB = least significant bit

  int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
  int sum  = (lastEncoded << 2) | encoded; //adding it to the previous encoded value

  if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
  if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;

  lastEncoded = encoded; //store this value for next time
}

And here is the weird output I've been getting from the Bot's side's XBee output:

Code:
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-387
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-38-35
-38-35
-387
67
6-35
-387
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
67
67
6-35
-387
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
67
6-35
-38-35
-387
6-35
-387
67
6-35
-387
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-38-35
-387
67
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-387
6-35
-387
67
67
6-35
-387
67
67
6-35
-38-35
3  Using Arduino / Networking, Protocols, and Devices / XBee data with random -38 and -35 values on: May 07, 2014, 09:40:44 pm
Hi all,

I am working on a project for Maker Faire this year as part of the Atmel booth, this part is basically a controller that controls a robot.  One side has a rotary encoder with an XBee, NeoPixel ring, and the other is an XBee plus a ZumoBot (Pololu).  XBee settings are correct, Series 1 directly to one another.  I have successfully coded the Rotary encoder, NeoPixel ring, and FuzzBot, with the data sent via XBee being mapped (with the map() function) from 0-9, so it is a two-digit repeating data stream that the XBee should be receiving.

However, when I use a Serial Echo program (prints whatever it's receiving basically, with no complex functions at all), the numbers come out fine, so the problem isn't in the XBees is my understanding.   I followed an XBee tutorial from Jeremy Blum, but the video said he was using a pre Arduino 1.0 version of the software.  The part of the code:  Serial.read() - '0'; he said was to convert the data into an integer, but I thought that was what I was doing before.  Then, I saw that he had Serial.flush() at the end of his code (which is not supported in 1.0), and I think that is where the problems are in the code.

Any help?

Thanks,
q

The code below is for the Bot:

Code:
/*  MFBA '14 Bot (NeoPixel Controller)

  Uses FuzzBot + mount with XBee and LED's, received by the Neo-
  Pixel controller board.
 
  created 5.4.14
  made by Quin Etnyre
 
  kudos to Bildr, Adafruit

*/

#include <ZumoMotors.h>

ZumoMotors motors;

int turnVal;
int potVal;

void setup() {
 
  Serial.begin(9600);
}

void loop() {
 
  while(Serial.available() == 0);
   int turnVal = Serial.read() - '0';
   int potVal = Serial.read() - '0';
   
   Serial.print(turnVal);
   Serial.println(potVal);
 
  int speedVal = map(potVal, 0, 9, 0, 5);
 
  switch (turnVal) {
    case 1:
      motors.setLeftSpeed(9*speedVal);
      motors.setRightSpeed(speedVal);
      Serial.println("1");
      delay(2);
      break;
    case 2:
      motors.setLeftSpeed(8*speedVal);
      motors.setRightSpeed(2*speedVal);
      delay(2);
      break;
    case 3:
      motors.setLeftSpeed(7*speedVal);
      motors.setRightSpeed(3*speedVal);
      delay(2);
      break;
    case 4:
      motors.setLeftSpeed(6*speedVal);
      motors.setRightSpeed(4*speedVal);
      delay(2);
      break;
    case 5:
      motors.setLeftSpeed(5*speedVal);
      motors.setRightSpeed(5*speedVal);
      delay(2);
      break;
    case 6:
      motors.setLeftSpeed(4*speedVal);
      motors.setRightSpeed(6*speedVal);
      delay(2);
      break;
    case 7:
      motors.setLeftSpeed(3*speedVal);
      motors.setRightSpeed(7*speedVal);
      delay(2);
      break;
    case 8:
      motors.setLeftSpeed(2*speedVal);
      motors.setRightSpeed(8*speedVal);
      delay(2);
      break;
    case 9:
      motors.setLeftSpeed(speedVal);
      motors.setRightSpeed(9*speedVal);
      delay(2);
      break;

  }
}

The code below is for the controller:

Code:
/* MFBA Controller
   
   Using NeoPixel Ring (14) x2, rotary encoder (SFE, R/G),
   slider pot (sm/med).
   
   created 5.4.14
   made by Quin Etnyre
   
   kudos to Bildr, Adafruit
*/

#include <Adafruit_NeoPixel.h>
 
#define PIN 4 // NeoPixel Pin #
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(16, PIN); //x16

uint32_t color  = 0xFFA500; // Start 'Qtechknow' Green

//these pins can not be changed 2/3 are special pins
int encoderPin1 = 2;
int encoderPin2 = 3;

volatile int lastEncoded = 0;
volatile long encoderValue = 0;

long lastencoderValue = 0;

int lastMSB = 0;
int lastLSB = 0;

int sensorValue;  // integer for potentiometer

void setup() {
  Serial.begin (9600);

  pinMode(encoderPin1, INPUT);
  pinMode(encoderPin2, INPUT);

  digitalWrite(encoderPin1, HIGH); //turn pullup resistor on
  digitalWrite(encoderPin2, HIGH); //turn pullup resistor on

  //call updateEncoder() when any high/low changed seen
  //on interrupt 0 (pin 2), or interrupt 1 (pin 3)
  attachInterrupt(0, updateEncoder, CHANGE);
  attachInterrupt(1, updateEncoder, CHANGE);
 
  pixels.begin();
  pixels.setBrightness(60); // 1/3 brightness
}

void loop(){
 
  sensorValue=analogRead(0); // slider pot
 
  int newValue = abs(encoderValue);

  int finalValue = map(newValue, 300, 0, 0, 15);
 
  pixels.setPixelColor(finalValue-1, 0);
  pixels.setPixelColor(finalValue+3, 0);
 
  pixels.setPixelColor(finalValue, color);
  pixels.setPixelColor(finalValue+1, color);
  pixels.setPixelColor(finalValue+2, color);
  pixels.show();
 
  int printVal = map(finalValue, 15, 0, 0, 9);
  int printPot = map(sensorValue, 0, 1023, 0, 9);

  Serial.print(printVal);
  Serial.println(printPot);
}


void updateEncoder(){
  int MSB = digitalRead(encoderPin1); //MSB = most significant bit
  int LSB = digitalRead(encoderPin2); //LSB = least significant bit

  int encoded = (MSB << 1) |LSB; //converting the 2 pin value to single number
  int sum  = (lastEncoded << 2) | encoded; //adding it to the previous encoded value

  if(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011) encoderValue ++;
  if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000) encoderValue --;

  lastEncoded = encoded; //store this value for next time
}

And here is the weird output I've been getting from the Bot's side's XBee output:

Code:
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-387
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-38-35
-38-35
-387
67
6-35
-387
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
67
67
6-35
-387
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
67
6-35
-38-35
-387
6-35
-387
67
6-35
-387
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-38-35
-387
67
67
6-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-38-35
-387
6-35
-387
6-35
-387
67
67
6-35
-387
67
67
6-35
-38-35
4  Using Arduino / Networking, Protocols, and Devices / Re: XBee Series 2 with Arduino + Accelerometer on: July 04, 2013, 07:20:48 pm
The accelerometer is transmitting data to the Arduino's serial port, which in turn is transmitting it through the XBees.  I'm using two official Xbee shields from Arduino (wireless proto and wireless SD).  

I would like to know how to transmit 2 pieces of data through XBees, and then filter the results on the other side so that the data is usable for the FuzzBot.  Thanks!
5  Using Arduino / Networking, Protocols, and Devices / XBee Series 2 with Arduino + Accelerometer on: July 03, 2013, 12:04:52 pm
Hi All,

About two months ago, I posted the FuzzBot Instructable, and wanted to have more options for the user, other than cleaning their house.  I decided to use Xbee Series 2 Zigbee modems, one in Coordinator AT mode, the other in Router AT.  I'm using the ADXL362 Breakout from SparkFun (https://www.sparkfun.com/products/11446), and the ADXL362 Library from Github by annem, which I modified (https://github.com/Qtechknow/ADXL362) with an Arduino UNO.  I have all of the code up and running for the transmitter side (Coordinator AT + Arduino + Accelerometer).  In the library, I modified it so that it automatically uses the map function to shield the values of the accelerometer from about -1500 to 1500 to -400 to 400, so that the receiver would just write that value to the motors on the FuzzBot.  Here is the code for the transmitter (which currently works):
Code:
/*  TiltBot Transmitter

Code for ADXL362 with an Arduino and XBee to transmit to the FuzzBot, giving
the user of this code control of the FuzzBot.

created by Quin (Qtechknow
made on 01 July 13
*/

#include <SPI.h>
#include <ADXL362.h>


ADXL362 xl;

int temp;
int XValue, YValue, ZValue, Temperature;


void setup(){
    Serial.begin(9600);
    xl.begin();             // Setup SPI protocol, issue device soft reset
    xl.beginMeasure();      // Switch ADXL362 to measure mode  
}

void loop(){
    
    // read the data of X and Y, formatted into -400, 400 for FuzzBot Motors
    Serial.print(" ");
    xl.readXData();
    Serial.print(" ");
    xl.readYData();
    delay(100);  // delay so that it doesn't go too fast
}

Here is the code for the receiver, that currently doesn't work.  I'm not sure what data form it should be in (int, char, byte) for the actual values.  The Serial readings will be a space, then x value, then another space, and then the y value over and over.

Code:
/* FuzzBot

Code for the ZumoBot, with Ping Sensor on Servo to do obstacle avoidance.

posted on Instructables

created 15 Apr 13
made by Quin (Qtechknow)
*/

#include <Ping.h>
#include <ZumoMotors.h>

Ping ping = Ping(4);

ZumoMotors motors;
 
void setup() {      
  Serial.begin(9600);    // start serial communication at 9600 baud
}
 
 
void loop()
{
   if(Serial.available()) {
     byte discarD = Serial.read();
     x = Serial.read();
     byte discard = Serial.read();
     double y = Serial.read();
     Serial.print(x);
   Serial.print(" ");
   Serial.print(y);
   Serial.print(" ");
   }
}

The above code outputs either -1, 0, or inbetween 45 and 55 on the Serial monitor for some reason.  It doesn't output the accelerometer data.

The below code, if I upload it to the receiver, it will output the exact accelerometer data.

Code:
void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()) {
  char a = Serial.read();
  Serial.print(a);
  }
}    

Any help?


Thanks!
Quin
6  Using Arduino / Programming Questions / Leonardo not Showing up in Serial Ports on: April 12, 2013, 08:57:24 am
Hi All,

I was running into some issues with the Arduino Leonardo when I was making this project.  I just bought the Arduino Touch Shield (https://www.sparkfun.com/products/10508) from SparkFun, and it is awesome!  Since I have a laptop that doesn't have the extra # keypad on the right side, I decided that I would make one.  I planned on using the Touch Shield as well as the Arduino Leonardo (because of the keyboard emulation function, which is so cool!), but I ran into some problems.

I tried to upload the code to the UNO first, because I believe that it's a little more consistent running programs than the Leonardo, since the UNO has been around for a little while longer.  I uploaded the example sketch from the Touch Shield page on SparkFun, and it worked perfectly fine.  The touch shield worked, and it printed out what numbers I pressed on the Serial monitor.

I then tried it with the Arduino Leonardo, which worked with uploading the code.  However, I couldn't open the Serial monitor.  My Arduino was definitely plugged into my computer.  When I looked at the available ports in Arduino (and also CoolTerm, a terminal program for Mac), my Arduino's Serial Port was gone (I'm on a Mac, so it's always something like /dev/tty.usbmodemfd131, and noticeable).  However, when I reset the Leonardo, it fades the D13 LED (I think that's how the board resets), and I can see the port on my screen.  I quickly try to open the Serial monitor, it opens, but it doesn't print anything out.  Then, it just goes back to the "where's the serial port?" loop again.  I've also tried to bootload the Arduino again, but it didn't work after that.

Any Help???

Thanks in advance,
Quin
7  Using Arduino / Project Guidance / Touch Shield Project on: April 11, 2013, 07:59:47 pm
Hi All,

I was running into some issues with the Arduino Leonardo when I was making this project.  I just bought the Arduino Touch Shield (https://www.sparkfun.com/products/10508) from SparkFun, and it is awesome!  Since I have a laptop that doesn't have the extra # keypad on the right side, I decided that I would make one.  I planned on using the Touch Shield as well as the Arduino Leonardo (because of the keyboard emulation function, which is so cool!), but I ran into some problems.

I tried to upload the code to the UNO first, because I believe that it's a little more consistent running programs than the Leonardo, since the UNO has been around for a little while longer.  I uploaded the example sketch from the Touch Shield page on SparkFun, and it worked perfectly fine.  The touch shield worked, and it printed out what numbers I pressed on the Serial monitor.

I then tried it with the Arduino Leonardo, which worked with uploading the code.  However, I couldn't open the Serial monitor.  My Arduino was definitely plugged into my computer.  When I looked at the available ports in Arduino (and also CoolTerm, a terminal program for Mac), my Arduino's Serial Port was gone (I'm on a Mac, so it's always something like /dev/tty.usbmodemfd131, and noticeable).  However, when I reset the Leonardo, it fades the D13 LED (I think that's how the board resets), and I can see the port on my screen.  I quickly try to open the Serial monitor, it opens, but it doesn't print anything out.  Then, it just goes back to the "where's the serial port?" loop again.  I've also tried to bootload the Arduino again, but it didn't work after that.

Any Help???

Thanks in advance,
Quin
8  Topics / Product Design / Re: Package of Hex Converter on: July 31, 2012, 03:37:53 pm
Thanks!
9  Topics / Product Design / Re: Inductors on: July 31, 2012, 02:00:11 pm
Ok.  Thanks!  I'm going to solder the first few boards by hand (will be pretty hard), then go with solder stenciling.
10  Topics / Product Design / Package of Hex Converter on: July 31, 2012, 01:59:08 pm
Hi All,

I was just creating a board based on the microSD shield from Sparkfun https://www.sparkfun.com/products/9802, and wanted to use the hex converter with the micro sd card slot.  When I originally found the part in eagle, it had no package whatsoever named.  Any help with the correct package?

Thanks,
Qtechknow
11  Topics / Product Design / Re: Inductors on: July 31, 2012, 01:46:58 pm
I'm using it in the same way that SparkFun is, so I think that it's alright with 4.7uH/1.62A.  Am I wrong?

Thanks!
12  Topics / Product Design / Re: Inductors on: July 31, 2012, 01:30:18 pm
Thanks.  Do you think that 4.7uH, 1.62A is okay when SparkFun uses 4.7uH, 1.2A?
13  Topics / Product Design / Re: Inductors on: July 31, 2012, 01:19:42 pm
Thanks.  Do you know if they carry CDRH3D28 packages of them???
14  Topics / Product Design / Re: Inductors on: July 31, 2012, 01:01:49 pm
Thanks.  Do you know which part that I should get from Mouser/Digikey?
15  Topics / Product Design / Inductors on: July 31, 2012, 12:52:46 pm
Hi All,

I'm not sure what an inductor is, and what it does.  I copied part of a schematic (http://www.sparkfun.com/datasheets/Prototyping/LiPower-v11.pdf) to go into a development board that I have.  The part number of the inductor is CDRH3D28, and I can't find the component on Digikey.  The value that I'm suppose to find is 4.7uH, 1.2A.  The products that I find are 4.7uH, 1.68A, and 10uH, 1.18A.  Any help on which part I should get (or a different part on Mouser)?

Thanks,
Qtechknow
Pages: [1] 2 3 ... 7