Pages: [1]   Go Down
Author Topic: Help with code for Signal Generator using DDS ad9850 and LCD keypad16x2  (Read 1332 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all.
New to this forum and to Arduino.
I have bought a Mega 2650 , AD9850 and a LCD keypad 16x2 and i want to control the frequency simply by the buttons and display the frequency on the LCD.
I have downloaded a few testcodes and button grabber sketches and i got an ide how to do this in separate sketches but i cant do it in one sketch.
If anyone can help out i would be very greatful.
Im really enjoying the Arduino and i want to learn alot.
Regards /Janne
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Welcome,
How well do you understand functions and the programming language of the Arduino. That is the essence of the solution to your problem of merging.

you must make a sort of choice/menu system on top level and from that calling one function that does what you want.

example
you have now sketch1 with a loop and sketch2 with a loop and your new program should become (in pseudo code)
Code:
void loop()
{
  int choice = MenuChoice();  // KeyPress;
  switch(choice)
  {
  case 1: loop1(); break;  // use better names that reflect the function e.g. sinus, triangel square etc
  case 2: loop2(); break;
  case 3: loop3(); break;
  case 4: loop4(); break;
  default: // do nothing
  }


void loop1() ...

etc






Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Im a beginner at programming the Arduino so this will really help.
Thanks
/Janne
Logged

Pages: [1]   Go Up
Jump to: