Show Posts
Pages: [1] 2
1  Development / Other Hardware Development / Re: NEW!! Rotary Encoder Breakout Board on: June 05, 2011, 05:58:15 pm
Yeah agreed maniacbug,

I'm no electronic engineer so I think I will leave this off the next revision until I can fully understand it's purpose. No point in selling something you can't support right!? smiley Thanks for this though.

Dan.
2  Development / Other Hardware Development / Re: NEW!! Rotary Encoder Breakout Board on: June 05, 2011, 01:46:23 am
Do you think these resistors and caps would be universal for all encoders of these dimensions? I'm not really sure of their purpose? How did you find that data sheet? Is it for the same encoder that sparkfun are selling or is it for a similar but different encoder? My knowledge of how to apply this circuit is very limited. So I would need to know it's relevance before I add it. I never was good at reading data sheets smiley

Dan.
3  Development / Other Hardware Development / Re: NEW!! Rotary Encoder Breakout Board on: June 04, 2011, 09:49:22 am
Cheers Rob,

I will add those changes to the next revision, once I sell these ones! smiley
4  Development / Other Hardware Development / NEW!! Rotary Encoder Breakout Board on: June 04, 2011, 09:23:20 am
Hey Guys,

This Breakout Board was designed to fit Sparkfun's Push Button Rotary Encoder. Handy for prototyping but also has holes for mounting on your project's interface panel. I'd love to get some feedback on this part as it's my first PCB design. Do you think there is a need for it? I know I needed it, but do any of you guys!?

You can purchase one from here:
http://www.inmojo.com/store/disassemble-reassemble/item/rotary-encoder-breakout-pcb-only/





For more info on this item and many other related ideas visit http://danthompsonsblog.blogspot.com/

Cheers guys.

Dan.
5  Using Arduino / Sensors / Re: rotary encoder/alternative ideas! unconventional suggestions welcome on: June 04, 2011, 09:03:04 am
Hey Guys,

Not sure if this is relevant but here's a breakout board that I designed for use with Sparkfun's Push Button Rotary Encoder. Handy for prototyping but also has holes for mounting on your project's interface panel.
http://www.inmojo.com/store/disassemble-reassemble/item/rotary-encoder-breakout-pcb-only/

Regards,

Dan.
6  Forum 2005-2010 (read only) / Syntax & Programs / Trying to use blink without delay + easydriver on: October 25, 2008, 10:57:40 pm
Hi There,

I'm trying to modify the blink without delay sketch to run my stepper motor. I'm using the easydriver board and it works fine with I have a simple loop that uses the (delay) function.

Now I'm trying to do the same but without using the delay function. I figured the code below would work. The motor does move a bit but it seems phasey. Can anyone see why this wouldn't work? The LED doesn't miss a beat. But the motor is not behaving.

Code:
/* Blink without Delay
 *
 * Turns on and off a light emitting diode(LED) connected to a digital  
 * pin, without using the delay() function.  This means that other code
 * can run at the same time without being interrupted by the LED code.
 *
 * http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
 */
int dirpin = 3;
int steppin = 5;
int ledPin = 13;                // LED connected to digital pin 13
int value = LOW;                // previous value of the LED
long previousMillis = 0;        // will store last time LED was updated
long interval = 100;           // interval at which to blink (milliseconds)

void setup()
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  pinMode(dirpin, OUTPUT);
  pinMode(steppin, OUTPUT);
}

void loop()
{

  // here is where you'd put code that needs to be running all the time.

  // check to see if it's time to blink the LED; that is, is the difference
  // between the current time and last time we blinked the LED bigger than
  // the interval at which we want to blink the LED.
  if (millis() - previousMillis > interval) {
    previousMillis = millis();   // remember the last time we blinked the LED

    // if the LED is off turn it on and vice-versa.
    if (value == LOW)
      value = HIGH;
    else
      value = LOW;

    digitalWrite(ledPin, value);
    digitalWrite(steppin, value);
  }
}


Thanks in Advance.
7  Forum 2005-2010 (read only) / Interfacing / Re: newbie trying to shift some bits on: April 11, 2009, 04:54:07 am
Well it took a couple of weekends actually. But I have learned a lot in the process.

Here's a link to the video.

I didn't need to use atoi() in the end, but I'm sure it will come in handy so thanks. I will post the code when I get time to clean it up.

Thanks again for the help,

Dan.
8  Forum 2005-2010 (read only) / Interfacing / Re: newbie trying to shift some bits on: March 27, 2009, 06:35:35 pm
Well the weekend is here. So I will try out some of those suggestions and let you know how it gos. Thanks everyone.
9  Forum 2005-2010 (read only) / Interfacing / Re: newbie trying to shift some bits on: March 27, 2009, 09:39:24 am
Quote
If you send the number as a string then you can use the atoi() function to convert the string to an integer.

I can't remember if there is a size limit to the integer you can get this way.

atoi() is a standard c function that is not documented in the Arduino reference. Google it to see the syntax.

atoi() will add quite some bytes to the size of your sketch though.

Edit: check this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1176289764

Thanks for this but I'm not sure why I would need to convert a string to and integer in this instance since I am not sending a string(that i am aware of) from pyserial. I am sending ASCII(which is represented in characters) but it seems that when it is read into the arduino it comes in as the same number I sent.

Example:
pySerial command in a python shell for sending
Code:
ser.write(chr(255))
Arduino command for receiving Data
Code:
startbyte = Serial.read();

The startbyte variable in the Arduino code, behaves as though it's holding the value I sent from python (255). So the relationship is 1 for 1 (or in this case 255 for 255).

This is good and what I want to happen. Only sending the values as ASCII means I can only send a number no higher than 255.

This is the limit for ASCII which is also the maximum number you can reconstruct from one byte(apparently).


Here is where it all gets a bit blurry for me...
Say I wanted to send a value from python which is 2555. I'm sure there are all sorts of ways to do this with the current ASCII encoded approach.
 
Like sending the ASCII Character for 2 then 5 then 5 then 5.
Or, send 25 then 55. Then rebuild these numbers back to the whole number in the Arduino code. But this feels like a cumbersome approach correct?

I'm thinking that there must be some way to get the whole binary number for 2555, then maybe split that into the minimum amount of bytes needed to send it over serial (one byte at a time)  then rebuilt the bytes back into one whole binary number, then convert that into the original 2555 number that was sent from pySerial.

Can anyone tell me if I'm on the right track? Sorry for rambling, I am just thinking out aloud.  :-/
10  Forum 2005-2010 (read only) / Interfacing / Re: newbie trying to shift some bits on: March 25, 2009, 07:26:06 am
It's for driving stepper motors and they could be gear reduced by a up to 60:1. So what if I said, 7 or 8 digits?...

The Serial.print command has some cool ways of translating the data into different data types for display, but not sure how this can help me get over 255 hump?
11  Forum 2005-2010 (read only) / Interfacing / Re: newbie trying to shift some bits on: March 25, 2009, 06:32:21 am
Thanks for clarifying AlphaBeta. So.. Before I try to understand word cast..

I feel I need to be clearer about my problem. Lets assume I know very little about all this.

This is my final goal:
I want to be able to write an arbitrary number to serial using pySerial that can be read 1 for 1 in the Arduino.

I have managed to get this to work with this kind of python command:
Code:
ser.write(chr(255))

Apparently this (chr) wraps any decimal value from 0-255, and you get back its ASCII equivalent. Example (chr65) you get back 'A' which the Arduino sees as 65 in Decimal value when you do Serial.read()

This is all great but it only lets me go so high. What is the best approach to take a very long value say, 12345678 over serial to the Arduino so I can use the exact same value in the Aduino code.

Sorry for being so obvious. But I feel I must to cover all bases.

I'm sure this is a very common task. But I am struggling to find any entry level info on this. So far I've found these links:
http://principialabs.com/arduino-python-4-axis-servo-control/ I found this really usefull if not going over 255
http://antipastohw.blogspot.com/2008/12/passing-large-values-between-arduino-to.html This kinda made sense but was not fully explaining the syntax.
http://www.arduino.cc/playground/Code/BitMath Interesting but don't know if this applies to my problem.

I know there are things like firmata and simple message system. But I would really like to learn the leanest approach to this.

Even if that means sending raw binary and reconstructing it(I don't know how). Can somebody please help me? Suggestions, Links, keywords even! All welcome

Thanks.  smiley
12  Forum 2005-2010 (read only) / Interfacing / newbie trying to shift some bits on: March 24, 2009, 05:10:23 am
Hello, I am trying to send serial data to the arduino and I am wanting to send large whole numbers in the fastest possible way.

I'm using some python and pyserial as my data input for now. Essentially, here is what I would like to be able to type as the python input command:

Code:
motor.move(2543)

I have started to look at bit sifting as a way to reconstruct things to 2 or more bytes. Example:
Code:
value = (userInput[0] << 8) + userInput[1];
 

Wondering if anyone has a working example of some Arduino code for this sort of thing?  

Also when I run:
Code:
Serial.println(1,BIN);
I get 110001

I thought a byte was 8 numbers. This is only 6? It seems to leave out the zeros at the start if it's not needed. Some ascii tables such as this one http://www.neurophys.wisc.edu/comp/docs/ascii/ list the char 1 as Binary 00110001?

Is this just a serial.print abbreviation or is it actually discarding the first zeros?

Not even sure if this is the right approach for what I am doing? Any suggestions would be most helpful.

Thanks in advance,

Dan.
13  Forum 2005-2010 (read only) / Interfacing / Re: Really Simple Instructions: arduino to Flash on: March 28, 2009, 08:05:00 pm
Hi Emma, I've never done it, but I've been saving this video for a rainy day. It's the best one I've found on the subject so far.

Good luck with it!
14  Forum 2005-2010 (read only) / Interfacing / Re: easydriver 4.2 on: June 16, 2010, 09:38:32 am
If you are using the suggested power supply in this tutorial it could be that you don't have enough current to make both motors run.
15  Forum 2005-2010 (read only) / Interfacing / Re: Serial communication on: March 09, 2009, 08:12:59 am
Thanks mem,

I was not aware of this till now. I use a blogger widget to do the formatting and firefox to view it. Just checked it in safari and explorer and yep your right, no scroll bar at the bottom and and the line does not continue when it hits the edge of the frame, instead it just goes to the next line. Bugger!

Not sure of a way around this. But I will look into it. Thanks for the heads up and thanks for that awesome serial example!

Dan.
Pages: [1] 2