Show Posts
Pages: [1] 2 3
1  Development / Other Software Development / Re: Accel stepper library with support for 28byj-48 motor on: February 01, 2014, 03:37:17 pm
ah - got it ...

nothing wrong with the original library

pins 2 and 3 need to be swapped, than both FULL4WIRE and HALF4WIRE work as expected
so - define a stepper as follows:
AccelStepper byj(AccelStepper::HALF4WIRE, 8, 10, 9, 11); // byj - pins 2 and 3 swapped !!!
(use HALF4WIRE for half stepping)

arduino pin:         ULN2003A IN pin       out pin      color code on the byj stepper
8                             in4                                D                  blue
9                             in3                               C                  pink
10                            in2                               B                  yellow
11                             in1                               A                  orange
+5v                          vcc                                                   red

sorry - don't know how to make a pretty table, hope this clarifies things
2  Development / Other Software Development / Re: No drop down menu scrolling in the IDE on: February 01, 2014, 02:29:27 pm
without any info on your system and version of the os this is useless information

scrolling works fine on my old mac running os 10.5.8
using the scroll wheel on the mouse, the up/down arrows, even the page up and down buttons

i have way too many sketches too - as i tend to save every experiment with the examples
most of the time I just open the folder manually and double click the file to open it
3  Development / Other Software Development / Re: Accel stepper library with support for 28byj-48 motor on: February 01, 2014, 02:12:40 pm
hi again ...

i delved a bit deeper myself, as you provide very little information
the version you used is 1.37 and it has a little bug. (which is fixed in the latest version, currently 1.39)

i still do not fully understand why you need a 8 step sequence to make the stepper run. the original stepper library manages to do so nicely with 4 step sequence. I am going to investigate further, and I will let you know.

just as part as my learning process, to really understand how steppers work, and how this library can be used
4  Development / Other Software Development / Re: Accel stepper library with support for 28byj-48 motor on: January 28, 2014, 08:51:12 am
good idea expanding the library, these steppers are cheap and great for experimenting

what version of the library did you change?
and what exactly did you change?
and why? what was missing in the library? afaik the 28byc is just a stepper with a gearbox attached, and it works with the standard library.

i am a bit new to steppers, so please excuse me if I overlook something obvious. i downloaded version 1.39
5  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE 1.0.5 does not start on my Mac OS X 10.5.8 on: January 23, 2014, 05:40:46 pm
succes! thanks for the detailed instructions! I hope this works for others too!

special thanks, and full credit to:
kelvin31415
EternalHerald

recap:
change the java version in info.plist
compile a thingie and add it to java

result:
no smoke coming from the computer
contents of bankaccount did not mysteriously disappear to nigeria
arduino 1.0.5 started up (disappointingly without fireworks and people cheering - after all that trouble!)
lets hope a next version just works without hassle smiley
yay for the helpful users on this forum!
6  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE 1.0.5 does not start on my Mac OS X 10.5.8 on: January 22, 2014, 05:35:24 pm
thanks for the tip

tldr: doesnt work

verbose:

java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03-389-9M3425)
Java HotSpot(TM) Client VM (build 1.5.0_30-161, mixed mode, sharing)

changed the info.plist to:

      <key>JVMVersion</key>
      <string>1.5.0_30</string>

icon bounces then quits
in console i get:


Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]: [JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]: Exception in thread "main"
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]: java.lang.NoClassDefFoundError: javax/swing/filechooser/FileNameExtensionFilter
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at java.lang.Class.forName0(Native Method)
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at java.lang.Class.forName(Class.java:242)
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at apple.launcher.LaunchRunner.loadMainMethod(LaunchRunner.java:56)
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
Jan 22 23:38:34 imac-van-frank [0x0-0x26026].cc.arduino.Arduino[213]:    at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Jan 22 23:38:34 imac-van-frank com.apple.launchd[92] ([0x0-0x26026].cc.arduino.Arduino[213]): Exited with exit code: 1
7  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE 1.0.5 does not start on my Mac OS X 10.5.8 on: January 21, 2014, 05:02:26 pm
thank you for your response
unfortunately, this is way beyond my knowledge - so i am going to follow your good advice:
"I wouldn't recommend it unless you know what you're doing in that area"

I hope it works for others

i must say - i am disappointed that arduino seems to be so demanding on the system. I sincerely hope a next version will work on older os/java.
8  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE 1.0.5 does not start on my Mac OS X 10.5.8 on: January 20, 2014, 05:20:19 pm
thank you for your response

i tried some things - but no luck so far. i tried editing the plist. i noted what happens when i try starting 1.0.5 in the console
i hope someone can shed some light on this.

with 1.6 (original) :
Jan 20 23:19:30 imac-van-frank [0x0-0x27027].cc.arduino.Arduino[188]: [JavaAppLauncher Warning] Java application launched from PPC or bad stub. Relaunching in 32-bit, and tagging sub-processes to prefer 32-bit with $JAVA_ARCH=i386.
Jan 20 23:19:30 imac-van-frank [0x0-0x27027].cc.arduino.Arduino[188]: [JavaAppLauncher Error] This process is [i386] and was re-exec'd from [i386], but for some reason we are trying re-exec to [].
Jan 20 23:19:30 imac-van-frank [0x0-0x27027].cc.arduino.Arduino[188]: [JavaAppLauncher Error] unable to find a version of Java to launch
Jan 20 23:19:30 imac-van-frank com.apple.launchd[94] ([0x0-0x27027].cc.arduino.Arduino[188]): Exited with exit code: 1

changed to 1.5:

Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]: [JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]: Exception in thread "main"
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]: java.lang.NoClassDefFoundError: javax/swing/filechooser/FileNameExtensionFilter
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at java.lang.Class.forName0(Native Method)
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at java.lang.Class.forName(Class.java:242)
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at apple.launcher.LaunchRunner.loadMainMethod(LaunchRunner.java:56)
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at apple.launcher.LaunchRunner.run(LaunchRunner.java:112)
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
Jan 20 23:23:17 imac-van-frank [0x0-0x28028].cc.arduino.Arduino[192]:    at apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Jan 20 23:23:17 imac-van-frank com.apple.launchd[94] ([0x0-0x28028].cc.arduino.Arduino[192]): Exited with exit code: 1
9  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE 1.0.5 does not start on my Mac OS X 10.5.8 on: January 19, 2014, 06:36:09 pm
same here
10.5.8 on a iMac intel core 2 duo

i lack the knowledge to troubleshoot this, so i stuck to 1.0.3 hoping a next update would work

anyone have a solution?
10  Development / Other Software Development / Re: EEPROMex library - An extension of the standard Arduino EEPROM library on: March 25, 2013, 01:39:28 pm
it just sequentially stores them
if you change the order in which you 'declare' the variables you mess it up
you can set a starting address

look at the example 'EEPROMEx' - run it and examine the output - it more or less explains itself

not specifically noted - but you can hard code the address - or use a variable of your own

this is just a convenient way to store variables without overlap or empty gaps

I haven't looked into the other examples - they seem to use another (smarter?) scheme to store variables

if you want - I'd be happy to share a code snippet of what I have so far

*edit* oops sorry - misread and thought you were talking about the EEPROMEx library
11  Using Arduino / Programming Questions / Re: EEPROM Library - Block Read / Write on: March 24, 2013, 10:24:13 am
apparantely somebody else noticed this void (update instead of blindly writing to EEPROM) - and coded a nice library for this

http://playground.arduino.cc/Code/EEPROMex

12  Development / Other Software Development / Re: EEPROMex library - An extension of the standard Arduino EEPROM library on: March 24, 2013, 10:16:28 am
Great - I just stumbled across the limitations of the standard arduino EEPROM library, and this will be real helpful

Thanks for sharing!

tip: make a note about memory used if you include this library, this is always an issue on the 168/328p based boards
tip: most RTC ds1302 modules sold on ebay include a i2c EEPROM - supporting external EEPROMs and in particular this module with a simple example would be a great idea. Most vendors don't even seem to know it is on their module (let alone the optional ds18b20!)
13  Using Arduino / Project Guidance / Re: ArduinoISP on serial rs232 on: March 22, 2013, 08:40:29 pm
Just a follow up ...

I eventually did get it working - using a stand alone 328p
it seems there is a bad connection on the breadboard

I will have to solder it up on some protoboard to get a reliable result.

powered by 4xAA rechargeable
max rs232 to convert rs232 to ttl level
stand alone 328p running the ArduinoISP sketch

When I find some time I'll post some schematics
14  Using Arduino / Project Guidance / Bandgap voltage problems (revisited) on: March 22, 2013, 08:27:10 pm
I am trying to write a sketch that measures the bandgap voltage as precise as possible, and writes the value to the eeprom for future reference
I want to use a 2.5v reference ic on AREF

for those dropping in on this discussion - please read up on the matter - a good starting point is this thread:
http://arduino.cc/forum/index.php/topic,38119.0.html

My code is heavely based on the previous work of Coding Badly, and RetroLefty

My problem is - the code using the sleep mode to produce better results seems to reset the analogreference to internal - where I would like to use an external reference, using a LM336 2v5 (an affordable 2.5 volt reference ic)

my code:

Code:
// use reference 2,47v on AREF to measure the bandgap voltage

#include <avr/sleep.h>

ISR(ADC_vect)
{
}

// This performs an A/D conversion using the current ADMUX settings.  You must set ADMUX before calling this function.
int rawAnalogReadWithSleep( void )
{
  // Generate an interrupt when the conversion is finished
  ADCSRA |= _BV( ADIE );

  // Enable Noise Reduction Sleep Mode
  set_sleep_mode( SLEEP_MODE_ADC );
  sleep_enable();

  // Any interrupt will wake the processor including the millis interrupt so we have to...
  // Loop until the conversion is finished
  do
  {
    // The following line of code is only important on the second pass.  For the first pass it has no effect.
    // Ensure interrupts are enabled before sleeping
    sei();
    // Sleep (MUST be called immediately after sei)
    sleep_cpu();
    // Checking the conversion status has to be done with interrupts disabled to avoid a race condition
    // Disable interrupts so the while below is performed without interruption
    cli();
  }
  // Conversion finished?  If not, loop.
  while( ( (ADCSRA & (1<<ADSC)) != 0 ) );

  // No more sleeping
  sleep_disable();
  // Enable interrupts
  sei();

  // The Arduino core does not expect an interrupt when a conversion completes so turn interrupts off
  ADCSRA &= ~ _BV( ADIE );

  // Return the conversion result
  return( ADC );
}

int bandgapRead(byte us =250) // returns raw measurement of bandgap with aref = 2,47v
{
       
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)  // For mega boards
//  const long InternalReferenceVoltage = 1100L;  // Adjust this value to your boards specific internal BG voltage x1000
        // REFS1 REFS0          --> 0 1, AVcc internal ref. -Selects AVcc reference
        // MUX4 MUX3 MUX2 MUX1 MUX0  --> 11110 1.1V (VBG)         -Selects channel 30, bandgap voltage, to measure
  ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR)| (0<<MUX5) | (1<<MUX4) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
 
#elif defined(__AVR_ATmega8__)  // Atmega8 has a 1.3V bandgap. UNTESTED!!! // http://forums.adafruit.com/viewtopic.php?f=25&t=12547
//  const long InternalReferenceVoltage = 1300L;  // Adjust this value to your boards specific internal BG voltage x1000
        // REFS1 REFS0          --> 0 1, AVcc internal ref. -Selects AVcc external reference
        // MUX3 MUX2 MUX1 MUX0  --> 1110 1.1V (VBG)         -Selects channel 14, bandgap voltage, to measure
  ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
#else  // For 168/328 boards
//  const long InternalReferenceVoltage = 1100L;  // Adjust this value to your boards specific internal BG voltage x1000
        // REFS1 REFS0          --> 0 1, AVcc internal ref. -Selects AVcc external reference
        // MUX3 MUX2 MUX1 MUX0  --> 1110 1.1V (VBG)         -Selects channel 14, bandgap voltage, to measure
  ADMUX = (0<<REFS1) | (1<<REFS0) | (0<<ADLAR) | (1<<MUX3) | (1<<MUX2) | (1<<MUX1) | (0<<MUX0);
#endif

  delay(us);  // Let mux settle a little to get a more stable A/D conversion
        // Start a conversion 
//  ADCSRA |= _BV( ADSC );
        // Wait for it to complete
//  while( ( (ADCSRA & (1<<ADSC)) != 0 ) );
        // Scale the value
//  return ((InternalReferenceVoltage * 1023L) / ADC); // calculates for straight line value
  return (rawAnalogReadWithSleep());
}

void setup() {
    // initialize the serial port
    Serial.begin(9600);

  pinMode(10, OUTPUT);    // set the digital pin as output:
  digitalWrite (10, HIGH);

  pinMode (9, OUTPUT);  // quick and dirty - make pin9 a gnd - for easy led connection when using pin10
  digitalWrite(9, LOW);

  analogReference (EXTERNAL);
  delay (200);
  pinMode (A5, INPUT);
  int dummy = analogRead (A5); // dummyread
  delay (10000);  // measuring the AREF pin produces a nice 2.47v during this delay
                  // but as soon as we try and measure the bandgap voltage
                  // analogreference seems to revert to internal

  digitalWrite (10, LOW);
}

void loop()
{

  Serial.println (bandgapRead());
  delay(200);
}


In case someone has a atmega8, please verify if the bandgap voltage is indeed 1.3v ?
Thank you all for your contributions
15  Using Arduino / Project Guidance / Re: ArduinoISP on serial rs232 on: March 13, 2013, 11:21:48 am
Update ...
I have tested my idea using the Uno R3 - and that works
And I realized - that if this works using rs232 - it could probably also work using a wireless serial protocol - with some adaptation to the sketch off course - but first i need to go back to the standalone 328p and figure out why that was not working as an isp
To be continued ...

Some more info for those that want to do the same sort of thing ... what works so far:

Arduino ide 1.0.3 on a mac
pl2303 usb to rs232 serial converter
max232 (rs232 to ttl) converter hooked up to tx/rx on a
arduino uno r3 clone, battery fed with 4xAA rechargable battery @ 5v, running the ArduinoISP sketch (adafruit fork)
connected to the target - a 328p

The sketch I am uploading is a customised blink sketch - the rate of the led is changed to show the sketch reached the destination smiley



hmmm - no inline youtube movies?

Pages: [1] 2 3