Show Posts
Pages: 1 [2] 3 4 ... 1166
16  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.

17  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 !!!

THANK YOU


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.
18  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.

19  Using Arduino / General Electronics / Re: Do i need capacitors on: July 18, 2014, 02:39:47 pm
Quote
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.

20  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:
mighty_opt.name=Mighty 1284p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xd6
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard

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.

21  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.
22  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

Code:
Serial.print(F("#KAL:"));             //Kalman Filtered angle
pad(kalAngleX);
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:

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



 
23  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.
24  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:

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

Things that don't work in an interrupt routine:

millis()
( 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
difficulty.

 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.
25  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.

26  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.


27  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
28  Using Arduino / Project Guidance / Re: Max AC input frequency arduino can read on: July 14, 2014, 07:31:50 pm
Hi,

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.

29  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.

30  Community / Bar Sport / Re: The Cracked Pot on: July 14, 2014, 03:17:54 pm
At least the cracked pot offers variable resistance...

You reminded me that I had an intro physics problem something like that. It's a tower with hole on the side. Calculate something about that hole and water flow. Variable resistance, not sure, but variable water speed, yes.

Flow rate dependent on the depth of water in the tank?


Yes, depth of water (head pressure) is equal to voltage. Crack in pot is equal to resistance (fixed value). Leak rate is equal to current flow and varies with water height. So Ohm's law applies.

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