Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
1
|
Using Arduino / Programming Questions / Re: Piezo Buzzer ( 2 - 6 MegaHertz) Pulsed Output
|
on: August 06, 2012, 08:56:26 am
|
The less than 30 lb piece of quartz on my Arduino oscillates physically 1t 16 MHz... make of it what you will.
The piece of quartz in your oscillator masses much less than a fraction of a single gram... Explain to me how your going to get a quartz crystal to vibrate at millions of hertz, much less resonate at those frequencies... My understanding is that the physical size/shape of the crystal is critical to tuning it for a given frequency... And of course that says nothing about resonating a 30+ pound composite object like a battery at millions of cycles per second...
|
|
|
|
|
2
|
Using Arduino / Project Guidance / Re: Autopilot for Ruddered Kayak
|
on: June 12, 2012, 06:37:32 pm
|
|
Wouldn't GPS be necessary if you want to autopilot to a given location, since holding magnetic course wouldn't help correct for cross currents moving the kayak laterally from the original destination point?
|
|
|
|
|
3
|
Forum 2005-2010 (read only) / Troubleshooting / Re: start and stop intervall - please help!
|
on: July 04, 2007, 07:39:19 pm
|
|
The interval function does not loop--it will exit. It just takes about 29 seconds.
Given that length of time monitoring buttons are problematic.
There are at least two solutions
1. Use interrupts to toggle a state variable 2. Rewrite the code to have a tighter loop around monitoring the key pins. To do this you could use the elapsed time functions to adjust the LED interval.
|
|
|
|
|
5
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Programmer not resp. after assigning pin0
|
on: June 07, 2007, 08:30:04 pm
|
|
As long as there are no electrical circuits connected to pin 0/1 (with some exceptions) and you press the reset button just prior to uploading a new sketch (within a couple of seconds). The code of the prior sketch should not effect the uploading of a new sketch.
Given that, I have noticed that occasionally I can not upload a new sketch after some tests. This has always gone away for me with a power reset on the arduino (disconnect from the computer) although occasionally it has required a restart of the computer as well.
|
|
|
|
|
7
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Processing .. Getting Started
|
on: June 15, 2007, 11:10:00 am
|
|
The processing serial library appears to have a slightly different syntax.
For example where processing says
println("Available Serial ports:");
arduino would say
Serial.println("Available Serial ports:);
A more significant difference is that the arduino Serial library has only one port so some of the functionality from processing is not available / applicable.
For instance the port = new Serial...
is just Serial.begin(baud rate) in arduino
while the processing
Serial.list() method simply doesn't exist in arduino since there is only one port.
A closer view of the example you mentioned indicates that the Graph processing code is designed to be run on desktop computer running the processing environment while the arduino runs the small section of code at the top of the example. Not sure where you can find the processing IDE but that code will not run within the arduino IDE.
|
|
|
|
|
8
|
Forum 2005-2010 (read only) / Troubleshooting / Re: Arduino BT com port issue
|
on: May 30, 2007, 08:13:04 am
|
|
In the device manager it is possible to change the com port assignment of virtual com port devices like USB and bluetooth. I believe it is under the port settings tab. I don't have any virtual com ports on this machine so I can't check until tonight.
|
|
|
|
|
9
|
Forum 2005-2010 (read only) / Troubleshooting / Using AVR Studio Simulator
|
on: May 18, 2007, 10:57:32 am
|
|
Is there a way to generate debug files to allow the use of the simulator to step through a sketch in C++ rather than assembler?
I'm working on a sketch for decoding RC5 IR signals and can't insert println statements in critical locations due to timing issues.
|
|
|
|
|
10
|
Forum 2005-2010 (read only) / Bugs & Suggestions / Serial.print(ln) suggestion
|
on: May 17, 2007, 07:40:29 pm
|
|
I've been using the BIN and HEX modifiers on the Serial.print methods and would like to suggest that these methods be modified to send 0x#### for HEX ad B########... for binary
When debugging over a serial monitor with mixed prints its easy to forget that 11 is 3 and not 11.
|
|
|
|
|
11
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: measure time <1ms
|
on: June 27, 2007, 08:11:13 pm
|
|
MindSpace,
I think your calculations for the effect of the prescalers is incorrect.
By my understanding with the 16,000,000Hz clock of the arduino the prescalers would have the following result.
clock/1 = 1/(16,000,000/1) = counter increments every 0.063Us clock/8 = 1/(16,000,000/8) = counter increments every 0.5us clock/64 = 1/(16,000,000/64) = counter increments 4us
Overflows will depend upon the initial value of the counter. With an initial value of 0 they are
When set to 0 the overflows would be clock/1 => 65536*0.063us = 4.096ms clock/8 => 65536*0.5us = 32.768ms clock/64 => 65536*4us = 262.144ms
The overflow time can be adjusted by replacing the 65536 with (65536 - init counter value) in the formula above.
|
|
|
|
|
12
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: measure time <1ms
|
on: June 04, 2007, 03:42:16 pm
|
It sounds like you are trying to use two photogates to measure the speed of an object -- or something similar. In this case TMR0 could allow you to measure up to about 1 ms between the events with a 4uS resolution as it is configured in the arduino environment. Custom timer configurations could allow uS resolution with indefinite time intervals. However, given your stated speed of 1.5 m/s and a 0.5m spacing you need to time an interval of approximately 333 ms, something like below should do for this situation. This setup should even work down to at least a 100mm spacing at 1.5m/s (abt 67ms) loop() { while (digitalRead(input1) == HIGH) { } time1 = millis(); while (digitalRead(input2) == HIGH) { } time2 = millis(); speed = 0.5 / ((time2-time1)/1000) // this should calculate speed in m/s given a separation distance of 0.5m }
|
|
|
|
|
14
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Thermistor readings... use lookup table?
|
on: July 18, 2007, 09:36:20 am
|
|
I would use a lookup table like below (made up values)
ADC Value Temperature 100 300 // Using integers it would be easy to use tenth of degrees if that level of precision is 200 500 // 500 => 50.0 degrees 300 700 400 900 500 1100 ...
This would be implemented by a search on the ADC value (adc) to find the array value below (a1) and the array value above (a2) and the corresponding temperatures (t1 & t2). The actual temp would be calculated as
t = (((adc-a1)*(t2-t1))/(a2-a1)) + t1 t needs to be a long even if a1,a2,t1, and t2 are integers --to prevent overflow.
with an adc reading of 250 the result would be t= (((250-200)*(700-500)/(300-200)) + 500 = (((50)*(200)/(100))+500 = (10000/100)+500 = 100+500=600
The equation is the y=mx+b but is reformated to allow for integer mathmatics. If precision is an issue then the values can be multiplied (and longs can be used) to increase precision without the need to use floating point math. Just watch out for overflows during calculations.
The table can be built from the temperature curve for the device and the best accuracy is obtained by selecting segments that are linear. The segment size does not have to be the same--some can be larger and others smaller depending upon the shape of the curve.
|
|
|
|
|
15
|
Forum 2005-2010 (read only) / Syntax & Programs / Re: Thermistor readings... use lookup table?
|
on: July 17, 2007, 04:46:44 pm
|
|
sti_robot:
Could you post you lookup table and description. I was surprised that it is so large. I would have expected something around a 17 element table to cover the 32-350 degree range you specified. Depending on the curve of the sensor this would yield approximately a 20 degree interporlation range (17 ranges)
|
|
|
|
|