Show Posts
Pages: [1] 2 3 ... 20
1  Development / Suggestions for the Arduino Project / Re: using Arduino Leonardo as USB audio input device on: August 12, 2014, 01:43:49 pm
ha, i missed copying the first line from the OS X console.

Code:
12.08.14 17:43:29,000 kernel[0]: USBF:    2718.835    AppleUSBEHCI::DoControlTransfer sync request on workloop thread.  Use async!
12.08.14 17:43:30,000 kernel[0]: AppleUSBCDCACMData: Version number - 4.2.1b5, Input buffers 8, Output buffers 16
12.08.14 17:43:30,000 kernel[0]: AppleUSBCDC: Version number - 4.2.1b5
12.08.14 17:43:32,000 kernel[0]: USBF:    2722.276    AppleUSBEHCI::DoControlTransfer sync request on workloop thread.  Use async!
12.08.14 17:43:33,000 kernel[0]: AppleUSBCDCACMData: Version number - 4.2.1b5, Input buffers 8, Output buffers 16
12.08.14 17:43:34,000 kernel[0]: USB Sound assertion in AppleUSBAudioDictionary at line 2927
12.08.14 17:43:34,000 kernel[0]: USB Sound assertion in AppleUSBAudioDictionary at line 1389
12.08.14 17:43:34,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 6049
12.08.14 17:43:34,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 364
12.08.14 17:43:34,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 286
12.08.14 17:43:34,000 kernel[0]: AppleUSBCDC: Version number - 4.2.1b5
2  Development / Suggestions for the Arduino Project / Re: using Arduino Leonardo as USB audio input device on: August 12, 2014, 01:03:11 pm
Hello Idrino,

i found your post this morning an gave it a try on OS X. (10.9.4). I'd really like to get this working.

After patching a brand new Arduino IDE (1.0.5) with your files, your example sketch compiled and uploaded with no errors and runs fine (printing to serial console).  Unfortunately this Macbook still won't list the Leonardo as an audio device.

The OS X Console shows something like this:
Code:
12.08.14 17:45:32,000 kernel[0]: AppleUSBCDCACMData: Version number - 4.2.1b5, Input buffers 8, Output buffers 16
12.08.14 17:45:33,000 kernel[0]: USB Sound assertion in AppleUSBAudioDictionary at line 2927
12.08.14 17:45:33,000 kernel[0]: USB Sound assertion in AppleUSBAudioDictionary at line 1389
12.08.14 17:45:33,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 6049
12.08.14 17:45:33,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 364
12.08.14 17:45:33,000 kernel[0]: USB Sound assertion in AppleUSBAudioDevice at line 286

I also gave it one try on a win 7 laptop with no better results after letting it search & install drivers for the Leonardo. Which OS are you using?
At this point, i really don't mind audio quality. Do you see a chance of getting this to work by tweaking some numbers in your files?
Do you have more information on this project out there or got it any further? It feels like you've been overseen for a while. I find this very interesting.

best, kuk




3  Forum 2005-2010 (read only) / Troubleshooting / Re: Pins 2 and 3 can't light up an LED? on: January 06, 2008, 04:47:43 pm
i'm sorry. then i don't know. there's no extra resistors for these pins on the board http://www.arduino.cc/en/uploads/Main/Arduino-Diecimila-schematic.pdf

what kind of led matrix did you use? did you try to connect just one LED to pin 2 (or 3 ) and GND ? same effect?
maybe the problem is not the provided current but the current sinking on the other side (GND or corresponding pin in your matrix setup). this wouldn't explain anything but help to track down the problem.

i'm sure i've used LEDs on all pins without noticing differences.

4  Forum 2005-2010 (read only) / Troubleshooting / Re: Pins 2 and 3 can't light up an LED? on: January 05, 2008, 07:21:16 am
did you declare these pins as outputs? the atmega has internal resistors.


Code:
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);

kuk
5  Forum 2005-2010 (read only) / Troubleshooting / Re: piezo to midi code help wanted ! on: December 18, 2007, 10:00:46 am
use the #Button when posting code
Code:
you get this box then, which makes it easier to read formatted code


you have to close your {blocks of code} like
Code:

if (someCondition==true){              //<-start  conditinal block {
    //do something here
}                                                  //-> closing the block }


or

Code:

void loop(){                                       //<-open loop block {
    if (someCondition==true){              //<-start  conditinal block {
        //do something here
    }                                                  //-> closing the if block }
}                                                      //-> closing the loop block }


that too was part of the problem in your first example.




6  Forum 2005-2010 (read only) / Troubleshooting / Re: piezo to midi code help wanted ! on: December 18, 2007, 08:02:14 am
now it works:
Code:
int ledPin = 13   ;    // Led connected to digital pin 13
int piezo1 = 0   ;     // Piezo 1 connected to analog 0
byte val = 0     ;     // variable to store the value read from the sensor pin
int statePin = 0; // variable used to store the last LED status , to toglle the light
byte THRESHOLD = 100;  // threshold value to decide when the detected sound is a knock or not
 
void setup()  
{
 pinMode(ledPin, OUTPUT); // declare the ledPin  as OUTPUT
 Serial.begin(31250);  // set MIDI baud rate  
}  
 
void loop(){
 // deal with first piezo
  val = analogRead(piezo1)/4;  
  if (val >= THRESHOLD) {  
   noteOn (144 , 10, 100);
    digitalWrite(ledPin, HIGH);
    delay(100);
  }  
}


// plays a MIDInote doesn't check to see that cmd is greater  than 127 or that data values are less than 127
void noteOn(char cmd, char data1,char data2) {
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
   Serial.print(data2, BYTE);
}

just a typo: you wrote 'data 2' instead of the variable name data2. and added a few semicolons at the bginning.

//kuk


EDIT: i probably changed more than needed to be done. don't mind this, took me some time to see the problem
7  Forum 2005-2010 (read only) / Troubleshooting / Re: how to start .... on: November 16, 2007, 08:33:57 am
do you need/want your pc in between? you could just hook a joystick (non-usb) to the second x-bee-arduino.

to get started i would suggest the following:
1- wire and get an arduino to talk to your bot, try programming some test movements like left-right, forwards-backwards.
2- if this works, try to control it with your pc: write an arduino sketch that takes commands from the serial port (via usb).
3- finally get that wireless working (if you haven't already), and throw it all together

i think there is a handful of information for the last steps here on the forum or the wiki/playground. if you built the bot, you maybe know how to interface it. there are tutorials on controlling motors and servos though as well.

good luck,
kuk
8  Forum 2005-2010 (read only) / Troubleshooting / Re: New code not running despite flawless flash on: November 01, 2007, 03:48:40 pm
Quote
 Or at least that seems to have fixed the problem for other people.
i just did a "re-burn" to a mini and an arduino NG's atmega. Same Symtoms before, everything fine afterwards.
9  Forum 2005-2010 (read only) / Troubleshooting / Re: interrupts and rotary encoders on: September 05, 2007, 06:34:03 pm
interrupts do (as their name implies) interrupt you program. that means, they might easily stop your program from running at all.
that is if you interrupt too often and your interrupt routine can't even finish before the next interrupt is triggered.

you shouldn't send serial messages from within the interrupt routine. keep it as simple as possible. keep it as fast as possible. count your values and give the control back to the main loop.

if you need to send a serial message when an interrupt occured, set a variable (interrupt_did_happen=true) and then send the message from within the main loop:

if (interrupt_did_happen ){
 //send message here
}


again, i hope this helps. if not, it might be good to post some code. or maybe try to explain what you want to do. this was just a shot in the dark (though i know what my difficulties with interrupts were).

//ku k
10  Forum 2005-2010 (read only) / Troubleshooting / Re: interrupts and rotary encoders on: September 05, 2007, 10:55:12 am
ps: by just having one channel triggering an interrupt you only get half of the resolution of your encoder. If you need the full resolution you have to use two interrupts per encoder.  
11  Forum 2005-2010 (read only) / Troubleshooting / Re: interrupts and rotary encoders on: September 05, 2007, 10:38:58 am
i'd say that he means it does not matter if you connect your encoder's pin "A" to arduino's port 3, and "B" to 4 <b>or the other way around</b>.

you're right that interrupts only work on pin 2 and 3. Paul's code only uses one interrupt on pin2, and "just reads" the value from pin4. Basically that means you could read a second rotary encody using the interrupt functionality of pin 3 plus any other digital in.

i hope this helped.

best, kuk
12  Forum 2005-2010 (read only) / Troubleshooting / Re: Timer, SSI-Interface on: May 07, 2006, 03:35:43 am
hi Stephan,

what kind of rotary encoder do you use?   i need to read the position of a hand crank.

best, kuk
(actually Stephan too smiley
13  Forum 2005-2010 (read only) / Troubleshooting / Re: strange behavior on my prog ! on: April 14, 2006, 05:59:43 pm
i can't get it work neither.

Code:
const char *sNomJour[7]   __attribute__((section(".eeprom"))) = {"dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"};
i don't think that this line writes anything to eeprom

i read out the eeprom in the main loop function afterwards but it always showed the values that i put there the run before.
Code:
      int EEadr;
      
      for ( EEadr=0;  EEadr<512;  EEadr++){

        value1 = eeprom_read_byte(EEadr);

        printInteger(EEadr);
        printByte(62); //">"
        printHex(value1);
        
        printNewline();
     // eeprom_write_byte(EEadr,0xDD); //uncommented in the second run
      }
is giving out 0xDD for all addresses.  :-/
14  Forum 2005-2010 (read only) / Troubleshooting / Re: strange behavior on my prog ! on: April 14, 2006, 11:31:13 am
hi guys,

i'm wondering if you figured this out in the meantime!?

as documented in another thread, i am interfacing a graphical LCD.
The original code (threw in by massimo) defines the ASCII characters in pixels.

like that:

Code:
static const byte FontLookup [][5] =
{
  {
    0x7E, 0x11, 0x11, 0x11, 0x7E     }
  ,   // A
  {
    0x7F, 0x49, 0x49, 0x49, 0x36     }
  ,   // B
  {
    0x3E, 0x41, 0x41, 0x41, 0x22     }
  ,   // C
  {
    0x7F, 0x41, 0x41, 0x22, 0x1C     }
     //D
//...
}
using this code the array is stored in RAM right? or is it in the flash memory??? (BTW what does the "static const" declaration do exactly?)

since every character takes 5 Bytes of memory and there are 95 printable ascii characters, i'm constantly running out of memory when working on the code. those 512 bytes of eeprom would come very handy!

is there a way to put all those pixel bytes into the eeprom using the ide? if i understand it right, the bootloader just copies the program into the flash-memory. is the bootloader able to write into eeprom at all?

i know i could copy the bytes from the RAM to the EEPROM using eeprom_write_byte(adr,val); but as it looks i'm not even able to get the program up running with *every* ascii character describe. :-(

another question:

is the eeprom used for anything when doing *normal* arduino stuff (no fancy c)? as a buffer for serial communication or something? or some debugging data maybe? just because it wasn't empty when i first accessed it for testing.


hope to hear from you.
i whish you all a nice easter weekend.

kuk

15  Forum 2005-2010 (read only) / Troubleshooting / Re: real string functions? on: April 24, 2006, 11:06:45 am
hi gck,

your last point is a good one. How do i know if my sketch is linking to an external library? the IDE does this linnking automatically, when i'm making use of "string functions" for example, right?

i thought that string.h was linked to anyway, like a kind of standard library. thats not right i guess.

and is there a way to tell how big those different libraries are? what libraries exist at all at the moment for arduino?

hey, and best wishes to massimo!

kuk
Pages: [1] 2 3 ... 20