Show Posts
Pages: [1] 2 3 4
1  Using Arduino / General Electronics / sourcing a nice 808 style drummachine button on: October 23, 2011, 02:35:42 pm
hey forum

i am considering making a simple drummachine for physical beatmaking. one of the great things about retro drummachines (apart from the amazing sounds) is the super nice buttons and the feel of them. i have been looking all over, but i can't find something which is similar to the classic 808 drummachine button.



does anyone have some clues on where to search? i would, of course, prefer something still in production.

thanks!
2  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 30, 2007, 02:10:58 am
hello again,
i uninstalled all java runtime environments with control panel>add/remove programs, downloaded java version 1.4.2.15, installed that, reinstalled arduino IDE. still the same slow response. running run.bat yields the same behavior. this is unbearable.
has anyone been able to fix this??
i can't think of anything anymore... please help!  :'(
3  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 27, 2007, 07:12:42 am
i did already - - same result, also with java 1.6 disabled (that is with the 1.6 folders moved out of program files>java)

starting up with run.bat and java1.5 i get the msg:
native lib version = RXTX-2.1-7
java lib version = RXTX-2.1-7

i don't know if this can help...

(oh: missing my old mac these days)
4  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 26, 2007, 04:39:59 am
i just tried moving the jre1.6.0 and jre1.6.0_01 folders from my java directory, only leaving jre1.5.0_10 - - this didn't help - - i'm not much of a windows wiz . . . should i uninstall some other way?
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 25, 2007, 06:48:54 pm
oh, OK...
is there a way of making arduino use an older version of java without uninstalling the newest version from my computer?
i mean - processing does it, right?
6  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 25, 2007, 06:11:56 pm
i just managed to download a sketch to my USB arduino - - i had to wait approx 15s before pressing reset on the board - - so it seems that everything is working - - but REALLY slowly  :-/
7  Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino IDE won't start on windows XP on: July 25, 2007, 05:55:35 pm
hi,

im having trouble running the arduino IDE (both 007 and 008) in XP SP2 as well. it starts up, but acts all weird.

its been a while since i've used arduino on my laptop, but arduino 007 worked just fine 6 months ago. i have updated java in the mean time to the following version:

Java Plug-in 1.6.0_01
Using JRE version 1.6.0_01 Java HotSpot(TM) Client VM

the IDE starts up, but slowly, and reacts strangely too. for instance: the first 3 menus work just fine, tools and help are slooow.

i've tried running run.bat on both 007 and 008 and its the same behaviour.

also, i've deleted any extra COM ports from my setup... still no luck.

only files named anything with cygwin on my computer is in the arduino folders.

processing runs just fine.

can anyone help, plz?

/j
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: Serial.print() kills my LEDs?? on: April 23, 2010, 04:26:56 pm
sorry guys, when cleaning out my code before posting it, i deleted the Serial.begin(2400); line -- ofcourse i need this smiley

i also need the small delays, since my LEDs are rotating at quite high speed -- so leaving them on/off for about 1/1000 of a second is about right for the pixel width i am after. next step is tweaking the code for more precise LED calibration, but i need serial communication over wireless for this, hence this post. smiley-wink

thanks for the debug tips. the problem still persist -- even if i set the delay for a full second

but for kicks, i tried entering a small delay(1) in stead of the serial.print() command -- and this works! the LEDs are blinking happily when the delay is in there. hm.... i have no idea why the small delay is needed, but for now my problems are solved i guess....

working code:
Code:
#include <avr/pgmspace.h>
#include <Flash.h>

int ledPin[8] = {
  2,3,4,5,6,7,8,9};

// this is the string to send to the sign - put it in program memory
FLASH_STRING (text,
    "     1. A ROBOT MAY NOT INJURE A HUMAN BEING OR, THROUGH INACTION, ALLOW A HUMAN BEING TO COME TO HARM.     "
    "     2. A ROBOT MUST OBEY ORDERS GIVEN TO IT BY HUMAN BEINGS EXCEPT WHERE SUCH ORDERS WOULD CONFLICT WITH THE FIRST LAW.     "
    "     3. A ROBOT MUST PROTECT ITS OWN EXISTENCE AS LONG AS SUCH PROTECTION DOES NOT CONFLICT WITH THE FIRST OR SECOND LAW.    "
    );

FLASH_ARRAY (byte, characterData,
  0,0,0,-6,-64,0,-64,40,-2,40,-2,40,100,-110,-1,-110,76,66,-92,72,16,36,74,
  -124,108,-110,-86,68,26,-64,124,-126,0,-126,124,80,32,-8,32,80,16,16,
  124,16,16,1,6,8,8,8,0,2,3,12,16,96,-128,124,-126,-126,-126,124,-128,-2,
  66,-122,-118,-110,98,68,-126,-110,-110,108,24,104,-120,-2,8,-12,-110,
  -110,-110,-116,124,-110,-110,-110,76,-128,-126,-116,-80,-64,108,-110,
  -110,-110,108,100,-110,-110,-110,124,0,34,1,38,16,40,68,40,40,40,68,40,
  16,64,-128,-118,-112,96,60,66,-71,-91,-87,-68,66,60,126,-112,-112,-112,
  126,-2,-110,-110,-110,108,124,-126,-126,-126,68,-2,-126,-126,-126,124,
  -2,-110,-110,-110,-126,-2,-112,-112,-112,-128,124,-126,-110,-108,94,-2,
  16,16,16,-2,-2,4,2,2,-4,-2,16,40,68,-126,-2,2,2,2,-2,64,32,16,32,64,-2,
  -2,64,56,4,-2,124,-126,-126,-126,124,-2,-112,-112,-112,96,124,-126,-126,
  -126,125,-2,-112,-104,-108,98,100,-110,-110,-110,76,-128,-128,-2,-128,
  -128,-4,2,2,2,-4,-64,56,6,56,-64,-4,2,2,-4,2,2,-4,-58,40,16,40,-58,-64,
  32,30,32,-64,-122,-118,-110,-94,-62,-1,-127,-127,-128,96,16,12,3,-127,
  -127,-1,64,-128,64,6,2,2,28,34,36,62,-2,18,34,28,28,34,34,20,28,34,36,
  -2,28,42,42,24,126,-96,-128,56,69,73,126,-2,16,32,30,-66,1,-66,-2,8,20,
  34,-2,62,16,32,30,16,32,30,62,16,32,30,28,34,34,28,127,36,68,56,56,68,
  72,127,62,16,32,18,42,36,32,-2,32,60,2,4,62,60,2,2,60,60,2,2,60,2,2,60,
  54,8,8,54,120,5,9,126,38,42,50,16,110,-127,-1,-127,110,16,64,-128,64,
  -128);
  
//index of each character
FLASH_ARRAY (int, characterIndex,
  0,2,4,7,12,17,24,29,30,32,35,40,45,47,50,52,57,62,64,69,74,79,84,89,94,
  99,104,106,108,111,114,117,122,130,135,140,145,150,155,160,165,170,
  171,175,180,184,191,196,201,206,211,216,221,226,231,236,243,248,253,
  258,261,266,269,272,275,275,279,283,287,291,295,298,302,306,307,309,
  313,314,321,325,329,333,337,340,343,346,350,354,361,365,369,372,375,
  376,379,383); //383 does not exist, is added to calculate width of char at 379
  
int maxStringSize;
int messageIndex;
char myChar;

void setup()   {                
  for (int i=0;i<8;i++) {
    pinMode(ledPin[i], OUTPUT);
  }
  maxStringSize =  text.length();  // find message size
  Serial.begin(2400);
}
  
void loop()                    
{
  myChar =  text[messageIndex]-32; //we start ASCII table at SPACE
  
  LEDUpdate();

  messageIndex++;
  messageIndex = messageIndex % maxStringSize;

}

void LEDUpdate() {
  int dataIndex = characterIndex[myChar];
  
  //Serial.print(dataIndex); // if i remove this one the LEDs don't update???
  
  delay(1); //but when this is entered it works again...
  
  int charWidth = characterIndex[myChar+1]-dataIndex;
  
  for (int i=0;i<charWidth;i++) {
    byte dataValue = characterData[dataIndex+i];
    for (int j=0;j<8;j++) {      
      int bitValue = bitRead(dataValue,j);
      if (bitValue == 0) { //LEDs are active low
        digitalWrite(ledPin[j], HIGH);
      } else {
        digitalWrite(ledPin[j], LOW);
      }
    }
    delay(1); //pause for pixel width
  }
  
  //insert space between characters
  for (int i=0;i<8;i++) {
    digitalWrite(ledPin[i], HIGH); //all black
  }
  delay(2); //pause for space
}
9  Forum 2005-2010 (read only) / Syntax & Programs / Serial.print() kills my LEDs?? on: April 23, 2010, 07:05:22 am
i am playing around with a circular POV LED writer. i have defined my own pixel font and i got the LEDs writing the text OK smiley so far so good.

weird thing happens though.... if i comment out my own debugging Serial.print lines, my LEDs stop flashing!!! this is really puzzling me....
i have narrowed it down to the Serial.print line in LEDUpdate() routine....
can anyone help me?

i just updated to arduino0018 - this changed nothing

thanks!
/j

below is my code:
Code:
#include <avr/pgmspace.h>
#include <Flash.h>

int ledPin[8] = {
  2,3,4,5,6,7,8,9};

// this is the string to send to the sign - put it in program memory
FLASH_STRING (text,
    "     1. A ROBOT MAY NOT INJURE A HUMAN BEING OR, THROUGH INACTION, ALLOW A HUMAN BEING TO COME TO HARM.     "
    "     2. A ROBOT MUST OBEY ORDERS GIVEN TO IT BY HUMAN BEINGS EXCEPT WHERE SUCH ORDERS WOULD CONFLICT WITH THE FIRST LAW.     "
    "     3. A ROBOT MUST PROTECT ITS OWN EXISTENCE AS LONG AS SUCH PROTECTION DOES NOT CONFLICT WITH THE FIRST OR SECOND LAW.    "
    );

FLASH_ARRAY (byte, characterData,
  0,0,0,-6,-64,0,-64,40,-2,40,-2,40,100,-110,-1,-110,76,66,-92,72,16,36,74,
  -124,108,-110,-86,68,26,-64,124,-126,0,-126,124,80,32,-8,32,80,16,16,
  124,16,16,1,6,8,8,8,0,2,3,12,16,96,-128,124,-126,-126,-126,124,-128,-2,
  66,-122,-118,-110,98,68,-126,-110,-110,108,24,104,-120,-2,8,-12,-110,
  -110,-110,-116,124,-110,-110,-110,76,-128,-126,-116,-80,-64,108,-110,
  -110,-110,108,100,-110,-110,-110,124,0,34,1,38,16,40,68,40,40,40,68,40,
  16,64,-128,-118,-112,96,60,66,-71,-91,-87,-68,66,60,126,-112,-112,-112,
  126,-2,-110,-110,-110,108,124,-126,-126,-126,68,-2,-126,-126,-126,124,
  -2,-110,-110,-110,-126,-2,-112,-112,-112,-128,124,-126,-110,-108,94,-2,
  16,16,16,-2,-2,4,2,2,-4,-2,16,40,68,-126,-2,2,2,2,-2,64,32,16,32,64,-2,
  -2,64,56,4,-2,124,-126,-126,-126,124,-2,-112,-112,-112,96,124,-126,-126,
  -126,125,-2,-112,-104,-108,98,100,-110,-110,-110,76,-128,-128,-2,-128,
  -128,-4,2,2,2,-4,-64,56,6,56,-64,-4,2,2,-4,2,2,-4,-58,40,16,40,-58,-64,
  32,30,32,-64,-122,-118,-110,-94,-62,-1,-127,-127,-128,96,16,12,3,-127,
  -127,-1,64,-128,64,6,2,2,28,34,36,62,-2,18,34,28,28,34,34,20,28,34,36,
  -2,28,42,42,24,126,-96,-128,56,69,73,126,-2,16,32,30,-66,1,-66,-2,8,20,
  34,-2,62,16,32,30,16,32,30,62,16,32,30,28,34,34,28,127,36,68,56,56,68,
  72,127,62,16,32,18,42,36,32,-2,32,60,2,4,62,60,2,2,60,60,2,2,60,2,2,60,
  54,8,8,54,120,5,9,126,38,42,50,16,110,-127,-1,-127,110,16,64,-128,64,
  -128);
  
//index of each character
FLASH_ARRAY (int, characterIndex,
  0,2,4,7,12,17,24,29,30,32,35,40,45,47,50,52,57,62,64,69,74,79,84,89,94,
  99,104,106,108,111,114,117,122,130,135,140,145,150,155,160,165,170,
  171,175,180,184,191,196,201,206,211,216,221,226,231,236,243,248,253,
  258,261,266,269,272,275,275,279,283,287,291,295,298,302,306,307,309,
  313,314,321,325,329,333,337,340,343,346,350,354,361,365,369,372,375,
  376,379,383); //383 does not exist, is added to calculate width of char at 379
  
int maxStringSize;
int messageIndex;
char myChar;

void setup()   {                
  for (int i=0;i<8;i++) {
    pinMode(ledPin[i], OUTPUT);
  }
  maxStringSize =  text.length();  // find message size
}
  
void loop()                    
{
  myChar =  text[messageIndex]-32; //we start ASCII table at SPACE
  
  LEDUpdate();

  messageIndex++;
  messageIndex = messageIndex % maxStringSize;

}

void LEDUpdate() {
  int dataIndex = characterIndex[myChar];
  
  Serial.print(dataIndex); // if i remove this one the LEDs don't update???
  
  int charWidth = characterIndex[myChar+1]-dataIndex;
  
  for (int i=0;i<charWidth;i++) {
    byte dataValue = characterData[dataIndex+i];
    for (int j=0;j<8;j++) {      
      int bitValue = bitRead(dataValue,j);
      if (bitValue == 0) { //LEDs are active low
        digitalWrite(ledPin[j], HIGH);
      } else {
        digitalWrite(ledPin[j], LOW);
      }
    }
    delay(1); //pause for pixel width
  }
  
  //insert space between characters
  for (int i=0;i<8;i++) {
    digitalWrite(ledPin[i], HIGH); //all black
  }
  delay(2); //pause for space
}
10  Forum 2005-2010 (read only) / Syntax & Programs / Serial.read() -- can i read a single bit? on: September 15, 2009, 05:52:49 am
hej,

i am trying to sync my synth project with a gameboy color running LSDJ, using serial communication over infrared light. the gameboy has an IR port, but due to the low processing power of the gameboy, it is quite hard for it to generate the required 38kHz carrier wave which is required, let alone to generate the the required 2400 baud serial bytes.
a solution to my sync problem could be to just blink the IR led on every step of the gameboy sequencer...

is there any way that blinks like that could be accepted as bits by the IR receiver, and could i read this with Serial.read()??

example of my IR setup is here: http://tthheessiiss.wordpress.com/2009/08/05/dirt-cheap-wireless/

datasheet of the IR receiver is here: http://www.alldatasheet.com/datasheet-pdf/pdf/168770/EVERLIGHT/IRM-3638N3.html

best,
jacob
11  Forum 2005-2010 (read only) / Syntax & Programs / music tracker code example on: May 13, 2009, 06:35:22 am
hej,
i am interested in making a self contained music tracker. music tracker as in pro tracker / noise tracker amiga style composition tool. i would base this on atmega/arduino, a LCD display and a simple interface.

i am interested in some code example on tracker software. can anyone help me?

also, it would be great to see other examples of people doing atmega based composition tools smiley so please post links if you have them!

best,
jacob
12  Forum 2005-2010 (read only) / Syntax & Programs / SID emulator on: May 13, 2009, 06:29:15 am
hi all,
reading up on the arduino SID emulator and SIDuino in the playground -- http://www.arduino.cc/playground/Main/SID-emulator -- i find quite a lot of broken links... does anyone have the correct links / files?
also, there is a mysterious reference to christoph's page: http://www.arduino.cc/playground/Main/SIDuinoCode --- which page is this?
best,
jacob
13  Forum 2005-2010 (read only) / Interfacing / messenger library and processing on: September 09, 2009, 10:44:32 am
hej all,
i am trying to send data from processing to arduino with the messenger library...
when running my processing example sketch, that was supplied with the library, the sketch never starts....  :-?
i just get
Quote
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Opening: /dev/ttyUSB0
Opening the Serial port forces the Diecimila to reboot...
...so wait till the Arduino boots and send out a message..
also, if i quit the processing sketch and try again, i get an extra error in the console:
Quote
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyUSB1

Opening: /dev/ttyUSB1
Opening the Serial port forces the Diecimila to reboot...
...so wait till the Arduino boots and send out a message...
so i never get out of this loop, and get the done waiting msg
Quote
 while (port.available() == 0 ) {}; // Wait till Arduino boots
  println("Done waiting.");
the only thing i changed in the code is the baud rate (to 2400)
what am i doing wrong?
what message is it that the arduino is supposed to send?

i am running this on ubuntu 9.04, arduino 0017 and processing 1.0.3

below is my arduino code
Code:
#include <Messenger.h>
// Instantiate Messenger object with the default separator (the space character)
Messenger message = Messenger();

// Create the callback function
void messageReady() {
  // Loop through all the available elements of the message
  while ( message.available() ) {
    Serial.print(message.readChar() );
  }
}


void setup() {
  
  // Initiate Serial Communication
  Serial.begin(2400);
  
  // Attach the callback function to the Messenger
  message.attach(messageReady);
  
  Serial.println("im ready");
}


void loop() {
  // The following line is the most effective way of using Serial and Messenger's callback
  while ( Serial.available() )  message.process(Serial.read () );
}
and the processing code is here
Code:
import processing.serial.*;

Serial port;                         // The serial port
String message = null;               // Incomming messages
String elements[] = null;            // Message elements
int values[] = {0,0,0,0,0,0};        // Values of the analog pins      


void setup() {
  
  size(420,150); //La taille de notre fenêtre
 
  frameRate(30);
  stroke(255);
  
  println("Opening: "+Serial.list()[0]);
  port = new Serial(this, Serial.list()[0], 2400);
  println("Opening the Serial port forces the Diecimila to reboot...");
  println("...so wait till the Arduino boots and send out a message...");
  while (port.available() == 0 ) {}; // Wait till Arduino boots
  println("Done waiting.");
  port.write(13);    // Clear messages still hanging out in th buffer;
  port.write("50");    // Send the desired sampling rate as ASCII characters: 33 milliseconds
  port.write(13);    // End the message with a carriage return;
}


void draw() {

  background(0);
  fill(255);
  
  while (port.available() > 0) {
   message = port.readStringUntil(13); // Read message until a carriage return
   if (message != null) {
     println(message);
    elements = splitTokens(message);
    for (int i =0; i < elements.length && i < 6; i++ ) {
      values[i] = int(elements[i]);
    }
   }
  }
  
  
  for (int i =0; i < 6; i++ ) {
     rect(12+(i*((width-24)/6.0)),25,((width-24)/6.0)-4,map(values[i],0,1024,0,100)); //
  }
  
}
14  Forum 2005-2010 (read only) / Interfacing / Re: translating strings to hex/dec/bin on: January 08, 2007, 03:23:52 am
thank you! i will give this a shot a bit later today.  smiley
i can see that this was a bit unclear:
the reason that XFF100000 could become 0..255 is that i'm evaluating every hex character one-by-one to determine if they are more or less than 8, and then assigning them a binary value, adding them in turn to my array/string, forming a binary number of 8 digits (0..255 dec)
15  Forum 2005-2010 (read only) / Interfacing / translating strings to hex/dec/bin on: January 07, 2007, 07:12:19 pm
hello,

i trying to read and decode a string sent from processing.
the string looks like this: XFF100000
it is 8 hex values to describe the individual settings of 8 LEDs (with 16 step grey scale). the first X is for string recognition.

i'm trying to read the 8 bytes and encode it properly to a maxim 7219 LED driver. for starters, i'm only doing simple on/off control of the LEDs (so, if value>8 then LED is ON else OFF)

i've assembled an array of 1s and 0s which i would like to feed to the max7219 chip, but i can't figure out how to translate string/array to one 2 digit hex number (or a decimal number between 0 and 255)

i have defined an array called serInString[]: int serInString[8];

but what i'd really like, is to just define a string and add to it like in processing. and then convert the string to hex with a simple hex(string) command? i'm confused as to how much of processings syntax can be used in arduino. and the link to float and string seems to be broken in the reference?!

anyways, here is my feeble code attempts as of so far:

Code:
 // read the serial port
  int val = Serial.read();

  // if the input is '-1' then there is no data
  // at the input, otherwise check out if it is 'X'
  if (val != -1) {
    if (val == 'X') {
      digitalWrite(ledPin, HIGH);
      for (int y=0; y<8; y++) {
        int rowval=0;
        for (int x=0; x<8; x++) {
          val = Serial.read();
          if (val > 8) {
            serInString[x] = 1;
          }
          else
          {
            serInString[x] = 0;
          }
        }
        max7219_put(max7219_row0, byte(serInString[]));
        delay(100);
      }
      digitalWrite(ledPin, LOW);
    }
Pages: [1] 2 3 4