Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« on: July 09, 2011, 04:00:49 pm » |
As an example I added a frequency generator to http://code.google.com/p/m2tklib/ (GLCD version of m2tklib). Only a graphics display and some input buttons are required for a nice frequency generator with adjustable duty. The display also shows the hardware values, because not all values can be created by the ATMEGA.  Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Greenville, IL
Offline
Edison Member
Karma: 11
Posts: 1289
Warning Novice on board! 0 to 1 chance of errors!
|
 |
« Reply #1 on: July 10, 2011, 06:47:18 pm » |
Nice job! That could be very useful!
Mark
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 3
Posts: 135
|
 |
« Reply #2 on: July 17, 2012, 02:28:48 pm » |
Hallo Oliver, Dein Projekt ist genau das, was ich gesucht habe, Danke dafür.
Leider funktioniert (bei mir) irgendetwas nicht richtig. Arduino 1.0.1 und m2tklib_arduino_glcd_1.08. der Rahmen um die Eingabefelder ist viel zu klein, Real Freq und Real Duty = 0 Arduino 1.0.1 und m2tklib_arduino_glcd_1.05. der Rahmen um die Eingabefelder passt, Real Freq und Real Duty = 0, Lautsprechen an Pin 3 kein Signal
es wäre toll, wenn es dafür eine Lösung gibt.
Gruss Kurti
|
|
|
|
|
Logged
|
Es gibt nur 10 Arten von Menschen: die, die das Binär-System verstehen und die, die es nicht verstehen.
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #3 on: July 18, 2012, 03:03:27 pm » |
Hallo Kurti Please excause for switching back to english. Many many thanks for reporting that bug. I have corrected M2tklib and uploaded the new release 1.08.1 Please download v1.08.1 from http://code.google.com/p/m2tklib/downloads/list. I have verified that the singal is available at pin 3 (Arduino Duemilanove) Thanks, Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Washington
Offline
God Member
Karma: 20
Posts: 717
Firefox & Arduino rocks
|
 |
« Reply #4 on: July 18, 2012, 05:00:23 pm » |
It looks like you are driving an 8 ohm speaker directly from an Arduino pin. The datasheet recommends no more then 40mA per pin. 5v / 8 ohms = 625mA. Far too high. I recommend putting a resistor of around 220 ohms in series but even 100 ohms will be better then nothing. Better yet is to use a transistor driver with base resistor.
|
|
|
|
|
Logged
|
Avoid throwing electronics out as you or someone else might need them for parts or use. Solid state rectifiers are the only REAL rectifiers. Resistors for LEDS!
|
|
|
|
Offline
Full Member
Karma: 3
Posts: 135
|
 |
« Reply #5 on: July 19, 2012, 04:13:21 pm » |
Hi, I got it, it's working !
the program is: uint8_t uiKeySelectPin = 0; uint8_t uiKeyDownPin = 1; uint8_t uiKeyUpPin = 2;
the function is: Switch at pin 0 = +1 and Enter Switch at pin 1 = select Switch at pin 2 = no function
You have to push the select-button to put the cursor to the right position. Then push the +1 button to select the number. After making the setting push the select button until Apply is highlighted. Then push the +1 button ( enter )
Thanks for this sketch Kurti
|
|
|
|
|
Logged
|
Es gibt nur 10 Arten von Menschen: die, die das Binär-System verstehen und die, die es nicht verstehen.
|
|
|
|
Germany
Offline
God Member
Karma: 69
Posts: 802
If you believe something is right, you won't see what's wrong (David Straker).
|
 |
« Reply #6 on: July 19, 2012, 05:30:15 pm » |
@smeezekitty
You are right, the resistor will add some safety to the hardware. However, to my knowledge, the current is also limited by the controller itself.
@kurti
In order to use all three buttons, you need to exchange the button handler. Instead of M2tk m2(&top_el_gridlist, m2_es_arduino, m2_eh_2bs, m2_gh_glcd_ffs); use M2tk m2(&top_el_gridlist, m2_es_arduino, m2_eh_4bs, m2_gh_glcd_ffs);
Oliver
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 3
Posts: 135
|
 |
« Reply #7 on: July 20, 2012, 09:51:14 am » |
Hi, I tried your fix and it's working, the switch at pin 2 has a function.
I checked the signal at pin 3 with my osci: - the calculation of the real duty has nothing in common with the signal ( Test 300 Hz, 50 Duty -> Real Freq.: 300, Real Duty 102, Frequency changed to 800 Hz, Real Duty changes to ) - the Frequency Generator only works above 60 Hz
Thanks for your tries Kurti
|
|
|
|
|
Logged
|
Es gibt nur 10 Arten von Menschen: die, die das Binär-System verstehen und die, die es nicht verstehen.
|
|
|
|
|