Polling should be fast enough, unless the thing sends thousands of pulses a second, in which case the Arduino will accomplish nothing beyond servicing the interrupts.
I had to laugh, though, when you mentioned fuel economy in the same paragraph with boat.
Haha yes, let’s call it “the least unecomical throttle sweet spot calculation”. I’m not sure if polling is fast enough, I don’t want to miss a pulse. I’ts not the only thing the arduino has to do.
Besides counting the flowmeter pulses, he has to decode the gps string for speed and coordinates, calculate distance between coordinates, calculate kilometres per litre, Keep track of the top speed and total distance, save information to eprom, control the servo, put information on the oled screen. All that preferably 10 times a second. and eventually update a GPS log file on a SD card (although this can be done once every 5 seconds or so)
I seriously don’t know how fast a arduino can do his calculations but I don’t want to wait while it could do other things. If this won’t bring the Arduino to his knees, I’m seriously impressed.
A text based LCD would be a lot simpler for a starter.
Totally agree, I’ve ordered also a two line text module for testing purposes, but for the final project I would like to implement this oled screen for his great readability in sunshine, and the freedom to make it more graphical appealing. If I look at the code it don’t seem to be too complicated. The most complicated stuff is already done in the library :-)
You mean SPI pins, and the SD card will simply use a different C(hip)/S(lave) select pin. Only one SPI device, defined by the CS/SS pin can be active at a time.
Yes SPI, my mistake. I understand the workings of the SPI, but I don’t understand the wiring done on the oled display. If I look up how I should hook up an SPI device:http://arduino.cc/en/Reference/SPI
On the Arduino Duemilanove and other ATmega168 / 328-based boards, the SPI bus uses pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK).
In my case (based on the tutorial earlier mentioned, and on another example):
- CS is connected to 12
- CLK is connected to 10
- MOSI is connected to 9
- RS/DC (MOSO???) is connected to 11
This is an connection diagram from the other source (without level shifter)
Totally different connections. Are these connections optional and can you use any of the ports on the arduino? (and define it in the setup part of the code).
Looking very strange to me is connecting the serial output of your GPS receiver to pin 2 but the signal of your flow meter to pin 1. If you use pin 2 or 3 for the flow meter you'll be able to use an interrupt to count the ticks of the flow meter.
Thanks! I probably have mistaken interrupt 1 with pin 1
@PaulS: From the datasheet. It's the minimal value there so it's the value I have to calculate with when checking for limits. That's why I think a level converter should be used.
Isnt this probably the minum voltage for the gps to do his job? If I feed it 2,4, the “high” will be 2,4. But if I feed it 3,3v the “High” will be 3,3v? It probably won’t harm the Arduino for trying a lower voltage ;-)
Thanks all for the advice!