Show Posts
Pages: 1 [2] 3 4 ... 1166
16  Using Arduino / Programming Questions / Re: Playing with watchdog and sleep mode - can't upload sketches anymore on: July 19, 2014, 07:33:05 pm
That was a frequent problem with mega boards that had the older version of the bootloader when using the WDT. One can usually get out of the 'lock up' by holding down the reset button and then upload a new sketch and only release the reset button when th e IDE says it's starting the upload. It can take a few attempts to get the timing correct. Long term fix is to burn the latest mega bootloader that can handle WDT correctly.

17  Using Arduino / Programming Questions / Re: When should the float and int variables be put in sketch? on: July 19, 2014, 07:26:06 pm
That is called a "variable's scope" and you should research that topic to get a good feel for the concept as it's an important feature of most modern programming languages.

18  Using Arduino / Microcontrollers / Re: ATMEGA 1284 - Definative Bootloader Solution.... on: July 18, 2014, 05:45:47 pm
Is that even though I dont want to use the bootloader ?
I shall try then...

... and it works !!!


Great. And don't worry about the bootloader being installed, the next time you upload a sketch via ISP the bootloader will be erased but the fuse values will remain.
19  Using Arduino / Project Guidance / Re: Avoiding some transient currents (?) during pin operation on: July 18, 2014, 02:45:49 pm
Not much to work on without your sketch code and schematic drawing. However as a wild ass guess are you using proper debounce functions (either software or hardware) ? Bouncing button contacts can 'fool with' a lot of sketches.

20  Using Arduino / General Electronics / Re: Do i need capacitors on: July 18, 2014, 02:39:47 pm
Arduino is powered through a 9V battery and the motor driver with 12V battery... Bluetooth, LCD , distance sensor are powered from arduino's 5V,

 Your main problem is that a small 9 volt battery will never be able to supply enough current for those devices, not enough current capacity. Even with a proper battery with enough current you will still be limited by the arduino 5V current capacity to power that much external stuff. You will need to use an external +5vdc power source with enough current capacity for all that stuff. How much current? Can't say without looking at the datasheets for each of the external devices to see what they require.

21  Using Arduino / Microcontrollers / Re: ATMEGA 1284 - Definative Bootloader Solution.... on: July 18, 2014, 02:31:39 pm
Yeah I read that somewhere and changed it... this is what I have now, but I still dont think its working (after rebooting IDE)

Code: 1284p 16MHz using Optiboot

For this to work just restarting the IDE does not implement it. You have reburn the bootloader using the IDE as that is the only time the IDE takes the new fuse values and burn them to the chip.

22  Using Arduino / General Electronics / Re: fun projects involving TV tuner antenna on: July 18, 2014, 02:26:52 pm
I recently got a hold of one of those old rabbit ear antennas with the circular antenna on it as well. I was wondering if there are any fun projects I can hack it into?

Make a hat out of it.
23  Using Arduino / Programming Questions / Re: Help understanding a script. on: July 18, 2014, 02:06:16 pm
well the lines that eventually print the final result are these

Serial.print(F("#KAL:"));             //Kalman Filtered angle
The result is indeed accurate. (there is a margin of error of course within 0.5 - 1 degree)

Can i use kalAngleX directly? Is the Serial.print(F()); and pad(); of any significance?

Well assuming you are going to use the analogWrite() function to drive the motor driver to the desired speed, you just need to scale the angle range (0-90 degrees) to the 0-255 pwm output range. So the basic conversion can be done using the map() function as so:

int outputSpeed;
int angle;
outputSpeed = map(angle,0,90,0,255);
analogWrite(pin#, outputSpeed);

24  Using Arduino / Sensors / Re: Pressure Transmitters on: July 17, 2014, 07:08:40 pm
The typical way to translate a arduino ADC value to a desired units of measurement is to utilize the mapping function.

So see if this makes sense:

 int pressure = map(analogRead(A0), 204, 1023, 0 100);   // read analog voltage to PSI units.
25  Using Arduino / Programming Questions / Re: problem in using interrupts on: July 17, 2014, 07:01:45 pm
Things that you cannot use in an interrupt routine because they deadlock the Arduino:

( there may be others in other libraries - anything that waits for other
interrupts, basically )

Things that don't work in an interrupt routine:

( there may be others in other libraries )

Things that aren't a good idea in an interrupt routine:

anything time-consuming, anything that can be done in loop() without

 Millis() is often used in ISRs as long as you realize that it doesn't increment while inside the ISR, however it's still good as a 'time stamp' to tell a sketch when the interrupt triggered and use that value for say a debounce function.
26  Using Arduino / Microcontrollers / Re: Why 16 Mhz clock??? on: July 15, 2014, 08:09:58 pm
I also ask Why 16mhz clock however the reason I ask it is because the avrs are rated to run at up to 20mhz so why not clock it at that frequency?

 Not hard to change it to 20 MHz.
Change the resonator, edit the boards.txt file and locate and burn a 20 MHZ bootloader and there you go.

27  Using Arduino / Project Guidance / Re: Using External ADC's on: July 15, 2014, 10:42:02 am
Your correct, there are four different strapping options for the single address selection pin, allowing up to four of these ADC/MUX modules to share a single I2C bus. So up to 16 single ended inputs or 8 differential inputs maximum.

28  Using Arduino / Sensors / Re: How can I conect a 4-20 mA sensor with external electrical supply on: July 15, 2014, 08:50:00 am
Dear retrolefty,

Could you explain this calcuations, please?.

Thanks in advance,

Simple Ohm's law, voltage = current X resistance

.020 amps X 250 ohms = 5 volts
.004 amps X 250 ohms = 1 volt
29  Using Arduino / Project Guidance / Re: Max AC input frequency arduino can read on: July 14, 2014, 07:31:50 pm

I am using a Mega 2560 for my project. I am inputting an AC signal to one of my Arduino's Analog In pins. I've read that Arduino is capable of reading a value from its Analong In pins up to 10000 times per second. Is this correct? Also, is there anything that can be done to increase this reading rate? Does the Baud rate have an effect on how fast the Arduino reads in analog values?

Thank you

Applying an AC voltage directly to a arduino analog input pin can/will result in pin damage or worst. Applied voltage to any analog or digital pin must be restricted to 0 to +5vdc, no negative voltage allowed as AC voltage has 50% of the time.

30  Using Arduino / Project Guidance / Re: Using External ADC's on: July 14, 2014, 06:14:39 pm
The ADS1115 is a very nice ADC/MUX that can be configured to switch between 4 single ended analog inputs (or 2 channels of differential inputs). Also the chip has a address pin that can be strapped high or low to gain a second I2C address, so two of these devices can share the two I2C pins (20,21) and handle reading up to 8 analog input signals. The Adafruit folks have a nice arduino library to make using this device pretty simple.

Pages: 1 [2] 3 4 ... 1166