Show Posts
|
|
Pages: [1] 2 3 ... 18
|
|
1
|
Using Arduino / Project Guidance / Re: Hexapod battery selection
|
on: May 16, 2013, 09:22:53 am
|
You will need the arduino mega servo shield like this  Each servo will draw about 1 Amp of current, for 18 servo, you can get 3000 to 4000 mAH 20C 7.4V 2s1p LiPo battery, but you to drop the voltage to 6V to drive the Servo by using DC to DC converter or UBEC.
|
|
|
|
|
6
|
Using Arduino / Project Guidance / Re: Autonomous Robot, problem with rc and gps
|
on: May 14, 2013, 07:47:12 pm
|
|
Still able be done with the Arduino Uno R3.
EM-406A GPS Module is using software-serial, if you change the pin connection, you have to change the soft-serial pins definition in the software.
Which Dagu Wild Thumper 4WD Chassis you used 34:1 or 75:1, the 34:1 had torque of roughly 5 kg-cm (70 oz-in) and 75:1 had higher torque of roughly 11 kg-cm (150 oz-in). What is the total weight of your car? What type battery? AH? Post your code will help.
|
|
|
|
|
9
|
Using Arduino / Project Guidance / Re: Can you run 2 different loops in 1 sketch?? need more help....
|
on: May 12, 2013, 09:00:31 am
|
Is this what you want? // what midi channel we're sending on // ranges from 0 15
#define midichannal 9 // Equates to MIDI Channel 10 #define midichannal 10 // Equates to MIDI Channel 11 #define midichannal 11 // Equates to MIDI Channel 12 #define midichannal 12 #define midichannal 13
// general midi drum notes #define note_F# #define note_D #define note_A #define note_G #define note_F // define the pins we use #define switchAPin 12 #define switchBPin 11 #define switchCPin 10 #define switchDPin 9 #define switchEPin 8
#define ledPin 13 // for midi out status int switchAState = LOW; int switchBState = LOW; int switchCState = LOW; int switchDstate = LOW; int switchEstate = LOW;
int ledPinA = A5; //LED connected to analog Pin 5 int ledPinB = A4; //LED connected to analog Pin 4
int currentSwitchState = LOW; int val,t;
void setup() { pinMode(switchAPin, INPUT); pinMode(switchBPin, INPUT); pinMode(switchCPin, INPUT); pinMode(switchDPin, INPUT); pinMode(switchEPin, INPUT); pinMode(A5, OUTPUT); pinMode(A4, OUTPUT);
digitalWrite(switchAPin, HIGH); // turn on internal pullup digitalWrite(switchBPin, HIGH); // turn on internal pullup digitalWrite(switchCPin, HIGH); // turn on internal pullup digitalWrite(switchDPin, HIGH); digitalWrite(switchEPin, HIGH); //Turn on LED digitalWrite(A5, HIGH); digitalWrite(A4, HIGH);
// set MIDI baud rate Serial.begin(57600); }
void loop() {
// deal with switchA currentSwitchState = digitalRead(switchAPin); if( currentSwitchState == LOW && switchAState == HIGH ) // push noteOn(0x90, 0x1E, 127); if( currentSwitchState == HIGH && switchAState == LOW ) // release noteOff(0x90, 0x1E, 0); switchAState = currentSwitchState; //read state of the piezo currentSwitchState = digitalRead(switchAPin);
//check if piezo is pressed //if so, the buttonState is HIGH if(currentSwitchState == LOW) {
//turn on the LED digitalWrite(A5, HIGH); } currentSwitchState = digitalRead(switchBPin); if( currentSwitchState == LOW && switchAState == HIGH ) // push noteOn(0x90, 0x2E, 127); if( currentSwitchState == HIGH && switchAState == LOW ) // release noteOff(0x90, 0x2E, 0); switchBState = currentSwitchState; //read state of the piezo currentSwitchState = digitalRead(switchBPin);
//check if piezo is pressed //if so, the buttonState is HIGH if(currentSwitchState == HIGH) {
//turn on the LED digitalWrite(A4, HIGH); }
currentSwitchState = digitalRead(switchCPin); if( currentSwitchState == LOW && switchAState == HIGH ) // push noteOn(0x90, 0x3E, 127); if( currentSwitchState == HIGH && switchAState == LOW ) // release noteOff(0x90, 0x3E, 0); switchCState = currentSwitchState;
currentSwitchState = digitalRead(switchDPin); if( currentSwitchState == LOW && switchAState == HIGH ) // push noteOn(0x90, 0x4A, 127); if( currentSwitchState == HIGH && switchAState == LOW ) // release noteOff(0x90, 0x4A, 0); switchCState = currentSwitchState;
currentSwitchState = digitalRead(switchEPin); if( currentSwitchState == LOW && switchAState == HIGH ) // push noteOn(0x90, 0x5B, 127); if( currentSwitchState == HIGH && switchAState == LOW ) // release noteOff(0x90, 0x5B, 0); switchCState = currentSwitchState;
} // Send a MIDI note on message. Like pressing a piano key
// channel ranges from 0 15
void noteOn(byte channel, byte note, byte velocity) { midiMsg( (0x90 | channel), note, velocity); }
// Send a MIDI note off message. Like releasing a piano key
void noteOff(byte channel, byte note, byte velocity) { midiMsg( (0x80 | channel), note, velocity); }
// Send a general MIDI message void midiMsg(byte cmd, byte data1, byte data2) { digitalWrite(ledPin,HIGH); // indicate we're sending MIDI data Serial.write(byte(cmd)); Serial.write(byte(data1)); Serial.write(byte(data2)); digitalWrite(ledPin,LOW);
}
|
|
|
|
|
14
|
Using Arduino / Project Guidance / Re: need help with LED controlling/disabling an out put
|
on: May 06, 2013, 06:21:52 am
|
int led1 = 13; int led2 = 12; int led3 = 10;
void setup(){ pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); } void loop(){
pinMode(led3, INPUT); //this does not work ??? why??? digitalWrite(led1,HIGH); digitalWrite(led2,LOW); // digitalWrite(led3,LOW); --> If you already set it to input, don't write delay(500); pinMode(led3, OUTPUT); //this does not work ?? pinMode(led1, INPUT); //this does not work ?? // digitalWrite(led1,LOW); --> If you already set it to input, don't write digitalWrite(led2,LOW); digitalWrite(led3,HIGH); delay(500); pinMode(led1, OUTPUT); //this does not work ?? pinMode(led2, INPUT); //this does not work ?? digitalWrite(led1,HIGH); // digitalWrite(led2,HIGH); --> If you already set it to input, don't write digitalWrite(led3,LOW); delay(500); pinMode(led2, OUTPUT); //this does not work ?? pinMode(led3, INPUT); //this does not work ?? digitalWrite(led1,LOW); digitalWrite(led2,HIGH); // digitalWrite(led3,HIGH); --> If you already set it to input, don't write pinMode(led3, OUTPUT); //this does not work ?? delay(500);
}
|
|
|
|
|
15
|
Using Arduino / Project Guidance / Re: Looking for USB Host overview
|
on: May 05, 2013, 12:20:30 pm
|
Read this, the Arduino USB Host shields was design as the hardware interface, but the supported device was up to the user who use it to write the interface software to talk to a USB device. USB in a NutShellMaking sense of the USB standard Starting out new with USB can be quite daunting. With the USB 2.0 specification at 650 pages one could easily be put off just by the sheer size of the standard. This is only the beginning of a long list of associated standards for USB. There are USB Class Standards such as the HID Class Specification which details the common operation of devices (keyboards, mice etc) falling under the HID (Human Interface Devices) Class - only another 97 pages. If you are designing a USB Host, then you have three Host Controller Interface Standards to choose from. None of these are detailed in the USB 2.0 Spec. USB defines class code information that is used to identify a device’s functionality and to nominally load a device driver based on that functionality.Some of the USB device like the cheap wi-fi dongle, have only RF transceiver in the hardware, the wifi protocol and IP stack was all in the device driver, hence you are unlikely to get it work with Arduino, perhaps too large to fit in the AVR micro's flash. For example I was tempted to recommend an Arduino to control model trains using a Sprog dcc controller (which connects to a PC by USB) but I realized I had no way of knowing whether it would work with an Arduino, or even what to look for in the product specifications that would help me to know.
To know the protocol for Sprog dcc controller, You will have to get a USB sniffer to be able to sniff the protocol.
|
|
|
|
|