Loading...
  Show Posts
Pages: 1 ... 12 13 [14] 15 16 ... 29
196  Using Arduino / Microcontrollers / Difference between ATMEGA32U4RC-AU & ATMEGA32U4-AU (Leonardo) on: January 25, 2013, 03:48:19 pm
Just gone to order some ATMEGA32U4 ICs from RS to make my own boards up but they have both ATMEGA32U4RC-AU & ATMEGA32U4-AU with the NON "RC" variant costing £3.66 in 10s or the "RC" ones at £3.98

When I go into the RC variant's page and click for the data sheet it brings up the same one !

So is there any difference and do I need to get a specific one?

I'm looking at messing with them to create a MIDI device and a Keyboard emulator etc to the USB is the important bit.
197  Using Arduino / General Electronics / Re: is there a better way to drop my voltage on: January 25, 2013, 03:05:32 pm
Simple opto-isolator with voltage divider giving the correct entry voltage and if required current limiting resistor then take 5v from the arduino into one side of the output and the other side will be your 5v to go to the input pin of the arduino with no worries about over voltage or current. smiley-grin
198  Using Arduino / General Electronics / Re: Audio switching on: January 25, 2013, 03:00:52 pm
Its going to be 4 channels to 8 outputs in total. 

My next challenge is a pot for levels that can be adjusted by hand or the arduino can adjust it..... So basically a voltage controlled pot........
199  Using Arduino / General Electronics / Re: Audio switching on: January 25, 2013, 12:59:17 pm
Oh yes, DIPs smiley-grin  I had totally forgotten about them.  I have a few in my parts collection, could well be the answer!

I hadn't realised that we have an AUDIO section so posted this in the wrong one....  If a mod sees this can they please move it, I can't report my own posts smiley-grin
200  Using Arduino / General Electronics / Re: Audio switching on: January 25, 2013, 12:47:35 pm
Input A only goes to B and/or C OR none
Input B only goes to D and/or E OR none
Input C only goes to F and/or G OR none....

Each line could be handled by 2 relays but solid state relays are not cheap and mechanical ones are expensive so looking for electronic suggestion really....
201  Using Arduino / General Electronics / Re: Audio switching on: January 25, 2013, 11:45:54 am
Not really, we are talking a hifi audio level signal.
202  Using Arduino / General Electronics / Audio switching on: January 25, 2013, 11:33:17 am
I need to switch multiple audio signals to multiple locations ie (A to B), (A to C) or (A to B & C) plus (D to E), (D to F) or (D to E & F) so basically multiple inputs which get switched to either 1 of 2 outputs, neither or both.

Just wondering what technique people would use to do this.....  The actual switching logic is a high pin from the arduino, a low pin would be off so basically A comes in and if pin 10 is high it goes to B and if pin 11 is high it also goes to C, either being low will turn that output off.  I would prefer to keep the audio signals isolated from the data board so would prefer not to connect the audio ground to the data board's ground and then switch the signal pins using transistors but would this be best?  What do people think.....  This is effectively like a computerised source switch for an amplifier.

The actual signal is an audio signal either un-amplified, line level or headphone level (I will not know before hand). 
203  Using Arduino / Project Guidance / Re: Using additional serial ports of 2560 for USB keyboard and MIDI control on: January 20, 2013, 03:00:35 pm
Hmmm....

What about plan D......

Active USB to PS2 keyboard adapter then emulate PS2 keyboard........  That is just serial data isn't it?  Will check library smiley-grin
204  Using Arduino / Project Guidance / Re: Using additional serial ports of 2560 for USB keyboard and MIDI control on: January 19, 2013, 05:37:08 pm
As this is a one off build for my own use and not to build for other people or several times I have decided on using a 2560 as the main controller which will be connected to the desktop computer, GLCD, SD card reader etc etc with a Leonardo as an add on board controlling the keyboard I/O..... Probably not the most elegant solution but at least it will work.
205  Using Arduino / Project Guidance / Re: Using additional serial ports of 2560 for USB keyboard and MIDI control on: January 19, 2013, 05:25:37 pm
Quote
reverting to plan B
That being a Leonardo?

No plan B was using a USB keyboard and messing with the mapping but since typing "plan B" I have just starting on "plan C" and I am searching on ebay for a Leonardo smiley
206  Using Arduino / Project Guidance / Re: Using additional serial ports of 2560 for USB keyboard and MIDI control on: January 19, 2013, 05:22:19 pm
Quote
How do I make Keyboard use Serial2 instead of serial0
That would all depend on what Keyboard is, wouldn't it? That's why snippets don't cut it.

If Keyboard is a library, you'll need to modify it to use a different Serial instance. You'll also need to figure out how to connect that Serial instance to the device that is on the receiving end.

Only the Serial instance is connected to the USB to serial converter chip/USB port.

Paul,

I was going to connect another FTDI chip to serial port 2, just as the original is connected to port 0 or am I barking up the wrong tree?


DOH!

Just realised that the "Keyboard" command is not supported on the 2560...... reverting to plan B
207  Using Arduino / Project Guidance / Using additional serial ports of 2560 for USB keyboard and MIDI control on: January 19, 2013, 05:10:32 pm
I'm building a musical control device which I want to be able to connect to a computer so will be using the standard TX & RX pins for the normal USB comms so that the arduino can talk to a desktop program BUT I am also wanting to connect to a MIDI keyboard and control the computer as if a USB keyboard (to start/stop/rewind DAW etc)....

Now MIDI....   Looking at the MIDI example it seems very much a straight forward job, just change serial to serial1

so......

Code:
void setup() {
  //  Set MIDI baud rate:
  Serial1.begin(31250);
}

void loop() {
  // play notes from F#-0 (0x1E) to F#-5 (0x5A):
  for (int note = 0x1E; note < 0x5A; note ++) {
    //Note on channel 1 (0x90), some note value (note), middle velocity (0x45):
    noteOn(0x90, note, 0x45);
    delay(100);
    //Note on channel 1 (0x90), some note value (note), silent velocity (0x00):
    noteOn(0x90, note, 0x00);   
    delay(100);
  }
}

//  plays a MIDI note.  Doesn't check to see that
//  cmd is greater than 127, or that data values are  less than 127:
void noteOn(int cmd, int pitch, int velocity) {
  Serial1.write(cmd);
  Serial1.write(pitch);
  Serial1.write(velocity);
}



Now I need to control an application running on the computer using the arduino pretending to be a USB keyboard.....

now this the main issue at the moment......

Code:
const int buttonPin = 2;          // input pin for pushbutton
int previousButtonState = HIGH;   // for checking the state of a pushButton
int counter = 0;                  // button push counter

void setup() {
  // make the pushButton pin an input:
  pinMode(buttonPin, INPUT);
  // initialize control over the keyboard:
  Keyboard.begin();
}

void loop() {
  // read the pushbutton:
  int buttonState = digitalRead(buttonPin);
  // if the button state has changed,
  if ((buttonState != previousButtonState)
    // and it's currently pressed:
  && (buttonState == HIGH)) {
    // increment the button counter
    counter++;
    // type out a message
    Keyboard.print("You pressed the button ");
    Keyboard.print(counter);
    Keyboard.println(" times.");
  }
  // save the current button state for comparison next time:
  previousButtonState = buttonState;
}


How do I make Keyboard use Serial2 instead of serial0
208  Using Arduino / Interfacing w/ Software on the Computer / Re: Cowascript - AVRDUDE HEX uploader etc for MacOS & Linux on: January 09, 2013, 05:31:51 pm
You are getting there smiley-grin

Looks like it just cannot locate the AVRDUDE application.  Should just be a matter of changing the location in the script.
209  Using Arduino / Installation & Troubleshooting / Re: Serial monitor broken ? on: November 08, 2012, 01:19:51 pm
PROBLEM SOLVED.....


The box [No line ending...New line...CR.....etc etc] had moved to "No line ending"

DOH!
210  Using Arduino / Installation & Troubleshooting / Re: Serial monitor broken ? on: November 08, 2012, 01:13:13 pm
I just quickly wrote this to test it:



Code:
char inputString[50];
int stringPos=0;

void setup() {
  Serial.begin(115200);
  Serial.println("Quick test");
}

void loop() {
  if (Serial.available()>0){
    digitalWrite(13, HIGH);
    Serial.println(Serial.available());
  } else {
    digitalWrite(13, LOW);
  }
  if (Serial.available()>0) {
    char inChar = (char)Serial.read();
    inputString[stringPos]= inChar;
    stringPos=min(stringPos+1,50);
    if (inChar == '\n') {
      digitalWrite(10, HIGH);
      delay(100);
      digitalWrite(10, LOW);
      Serial.println(inputString);
      stringPos = 0;
      for (byte i = 0; i < 50; i++) {inputString[i]=(char)0;}
    } else {
      Serial.print("Part = ");
      Serial.println(inputString);
    }
  }
}


And it works fine.....  BUT it still doesn't work in the original sketch or previous versions that WERE working fine.

Investigating......
Pages: 1 ... 12 13 [14] 15 16 ... 29