Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / OBD-II with Arduino? on: October 03, 2013, 10:00:04 pm
Hello! My dad recently bought an ELM-327 wireless OBD-II reader, but needless to say, it didn't work right out of the box. The wireless module appears to be in working condition, and the OBD plug is salvageable. Would it be possible, with the proper code, to implement these into a protoshield to save the day? Here's a datasheet of the Wi-Fi module: http://www.wifitop.com/TLN13UA06.html
The 3.3v and reset lines seem to me to be a tipoff that it's somehow Arduino compatible. Any suggestions or feasibility comments?
Thanks,
Dawmasta
2  Using Arduino / Programming Questions / Timebomb-Styled Clock Issue on: January 27, 2013, 10:13:17 pm
Hello!
I'm trying to program a 4-digit 7-segment display and piezo (with more components later) to count down until a climactic... something. I've got the 7-segment display working nicely, but when I add in the piezo, things get iffy. It should buzz for 50ms and be off for 950ms, but the display also follows these delays, making it impossible to read. If anyone can correct my code, I'd be very grateful!
Code:
int digit1 = 11; //PWM Display pin 1
int digit2 = 10; //PWM Display pin 2
int digit3 = 9; //PWM Display pin 6
int digit4 = 6; //PWM Display pin 8
int segA = A1; //Display pin 14
int segB = 3; //Display pin 16
int segC = 4; //Display pin 13
int segD = 5; //Display pin 3
int segE = A0; //Display pin 5
int segF = 7; //Display pin 11
int segG = 8; //Display pin 15

void setup() {               
  pinMode(segA, OUTPUT);
  pinMode(segB, OUTPUT);
  pinMode(segC, OUTPUT);
  pinMode(segD, OUTPUT);
  pinMode(segE, OUTPUT);
  pinMode(segF, OUTPUT);
  pinMode(segG, OUTPUT);

  pinMode(digit1, OUTPUT);
  pinMode(digit2, OUTPUT);
  pinMode(digit3, OUTPUT);
  pinMode(digit4, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(13, OUTPUT);
}
void loop() {
 
//---------------------------------------------------------------------TROUBLE SPOT-----------------//
  digitalWrite(2, HIGH);
  delay(50);
  digitalWrite(2, LOW);
  delay(950);
  displayNumber(59-millis()/1000);

  while( millis() > 60000) {
    displayNumber(0);}
//---------------------------------------------------------------------/TROUBLE SPOT----------------//
void displayNumber(int toDisplay) {
#define DISPLAY_BRIGHTNESS  500

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  long beginTime = millis();

  for(int digit = 4 ; digit > 0 ; digit--) {
    switch(digit) {
    case 1:
      digitalWrite(digit1, DIGIT_ON);
      break;
    case 2:
      digitalWrite(digit2, DIGIT_ON);
      break;
    case 3:
      digitalWrite(digit3, DIGIT_ON);
      break;
    case 4:
      digitalWrite(digit4, DIGIT_ON);
      break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;

    delayMicroseconds(DISPLAY_BRIGHTNESS);

    lightNumber(10);

    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
  }

  while( (millis() - beginTime) < 10) ;
}

void lightNumber(int numberToDisplay) {

#define SEGMENT_ON  LOW
#define SEGMENT_OFF HIGH

  switch (numberToDisplay){

  case 0:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_ON);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_OFF);
    break;

  case 1:
    digitalWrite(segA, SEGMENT_OFF);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_OFF);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_OFF);
    digitalWrite(segG, SEGMENT_OFF);
    break;

  case 2:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_OFF);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_ON);
    digitalWrite(segF, SEGMENT_OFF);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 3:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_OFF);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 4:
    digitalWrite(segA, SEGMENT_OFF);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_OFF);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 5:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_OFF);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 6:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_OFF);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_ON);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 7:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_OFF);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_OFF);
    digitalWrite(segG, SEGMENT_OFF);
    break;

  case 8:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_ON);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 9:
    digitalWrite(segA, SEGMENT_ON);
    digitalWrite(segB, SEGMENT_ON);
    digitalWrite(segC, SEGMENT_ON);
    digitalWrite(segD, SEGMENT_ON);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_ON);
    digitalWrite(segG, SEGMENT_ON);
    break;

  case 10:
    digitalWrite(segA, SEGMENT_OFF);
    digitalWrite(segB, SEGMENT_OFF);
    digitalWrite(segC, SEGMENT_OFF);
    digitalWrite(segD, SEGMENT_OFF);
    digitalWrite(segE, SEGMENT_OFF);
    digitalWrite(segF, SEGMENT_OFF);
    digitalWrite(segG, SEGMENT_OFF);
    break;
  }
}
3  Using Arduino / Installation & Troubleshooting / COM Port 3 Not Found? on: January 27, 2013, 12:27:52 am
Hello!
I've been struggling to find an answer to this seemingly simple problem: My computer won't recognize COM Port 3. It recognizes my Uno as a device on COM3, but the IDE seems to not recognize it. I noticed the TX/RX lights aren't lightning, but this may just be because it's not receiving a signal... The board was working perfectly fine earlier today, but this problem began an hour ago. I've tried rebooting my computer, unplugging and replugging the cable, resetting the board, and updating the drivers; nothing works! If anyone can offer possibilities for why I'm getting this error, I'd be very thankful!!
Thanks,
Jared
4  Using Arduino / Displays / Anyone want a cheap 16x2 LCD breakout? on: January 25, 2013, 11:24:02 pm
Hello! I recently had PCBs made to be simple breakouts for 16x2 LCD displays (16-pin standard), and the minimum order was ten. I have nine spares, which need just through-board pins, a display, and a potentiometer. I'm selling 'em for $3 a pop (I'll cover shipping) and was wondering if anyone was intereted?
http://tinyurl.com/atsdg56- Top of board
http://tinyurl.com/aj9aj7y- Bottom of board
http://tinyurl.com/a5l8tek- Top of assembled board
http://tinyurl.com/b3mjqj7- Bottom of assembled board
For further info contact me at dawmasta@gmail.com
 smiley
5  Using Arduino / Programming Questions / Re: Line Wrap in Serial Monitor on: January 17, 2013, 10:31:19 am
So is there a way to set a variable equal to the current number of characters?
6  Using Arduino / Programming Questions / Re: Line Wrap in Serial Monitor on: January 10, 2013, 08:26:12 pm
It's not reading MY tweets (I don't even have a Twitter...), it's reading from another person's feed.
7  Using Arduino / Programming Questions / Re: Line Wrap in Serial Monitor on: January 08, 2013, 01:18:44 pm
Quote
How would I add the newline command into a tweet?
There is not a "newline command". There is a newline character (\n). Why you want that in the tweet, I don't know.
I need the tweet to fit in the serial monitor, starting a new line if necessary.
8  Using Arduino / Programming Questions / Re: Line Wrap in Serial Monitor on: January 08, 2013, 12:22:51 pm
How would I add the newline command into a tweet?
9  Using Arduino / Programming Questions / Line Wrap in Serial Monitor on: January 07, 2013, 08:47:40 pm
I've got a program that grabs tweets and prints them in the serial monitor, but often I have to scroll to see the entire quote. Is there a way to tell the Arduino (I have an Uno R3) to wrap the text after a certain number of characters?
10  Using Arduino / Project Guidance / Re: Password Bot? on: January 07, 2013, 01:58:07 pm
I just found this: http://mitchtech.net/arduino-usb-hid-keyboard/
11  Using Arduino / Project Guidance / Re: Password Bot? on: January 07, 2013, 01:54:15 pm
Sorry, I forgot to mention I have the Uno Rev. 3.  smiley-sweat
12  Using Arduino / Project Guidance / Password Bot? on: January 07, 2013, 01:27:25 pm
I'm going to keep this short and cut to the chase- Does anyone know if it would be possible to wire digital pins to a male USB connector, plug it into a computer, and send keystrokes to the computer when I press a button? I'd love to be able to get to my computer's login screen and just press a button rather than CTRL-ALT-DELETE'ing and entering a password.
Derp!
13  Using Arduino / Programming Questions / Programming Question..? on: November 17, 2012, 11:22:55 pm
Hello!
I'm new to programming, so my skills mainly include looking up commands and editing existing code. I have a code that should print the current temperature in F to the console, and if the temperature goes over 75 degrees it will activate a case fan. This all works well, but when the temperature goes below 75, the fan doesn't stop. Here is my code, as messy as it is.. :p If anyone can help out by fixing the code and/or telling me how I majorly screwed up, that would be seriously appreciated.
Thanks!  smiley-grin

/* 
    Arduino thermistor example software
    Tutorial:  http://www.hacktronics.com/Tutorials/arduino-thermistor-tutorial
    Copyright (c) 2010 Mark McComb, hacktronics LLC
    License: http://www.opensource.org/licenses/mit-license.php (Go crazy)
*/

#include <LiquidCrystal.h>
#include <math.h>

/*
See tutorial for Thermistor connections

LCD Connections:
rs (LCD pin 4) to Arduino pin 12
rw (LCD pin 5) to Arduino pin 11
enable (LCD pin 6) to Arduino pin 10
LCD pin 15 to Arduino pin 13
LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2
*/


int pin2 = 2;


void setup(void) {
  Serial.begin(9600);
pinMode(pin2, OUTPUT);
}
double Thermister(int RawADC) {
  double Temp;
  // See http://en.wikipedia.org/wiki/Thermistor for explanation of formula
  Temp = log(((10240000/RawADC) - 10000));
  Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
  Temp = Temp - 273.15;           // Convert Kelvin to Celcius
  return Temp;
}

void printTemp(void) {
  double fTemp;
  double temp = Thermister(analogRead(0));  // Read sensor

  fTemp = (temp * 1.smiley-cool + 32.0;    // Convert to USA
  Serial.print(fTemp);
  Serial.println(" F"); 
 
  if(fTemp > 75)
 digitalWrite(pin2, HIGH);

   
 
}

void loop(void) {
  printTemp();
  delay(1000);
}
14  Using Arduino / Programming Questions / Programming Simple Synthesizer on: November 15, 2012, 11:06:58 pm
Hello! I'm entirely new to Arduino, but I've got the wiring basics down, so I decided to try a simple project. I've wired up five pushbuttons and a piezo on a breadboard, and want to have each button play a note from C through G when pressed. The five buttons are in pins 3-7 and the piezo is in 2. If anyone could help me with a simple program, I'd be more than grateful. (I have the Arduino Uno if that helps.)

Thanks a ton!
Dawmasta
Pages: [1]