473,394 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Oscilloscope Signals

Greetings,

I am stuck on a topic for TAFE and cannot get my head around it.

I need to Write a program to use a D to A converter board to output various signals which can be viewed on an oscilloscope.

I have made the Triangle wave, which works, but am stuck on the sine wave.

Code for sine wave thus far is:

int val;
int DCBias = 128;
int steps = 128;
int lp;


double dg = 3.141592654 / (steps/2);
val = sin(lp * dg) * 127 + DCBias;


for (lp = 0; lp <= 128; lp ++)
{ outp (DataPort,val);
delay (20);
}

printf("Press any key to exit Sine Wave output\n");
while (!kbhit()) break();
It will not compile and I keep getting errors. I think the problem lies within the last line of while the keyboard is hit, perform a break.

Thanks in advance for any help.
Aug 3 '07 #1
2 2135
Banfa
9,065 Expert Mod 8TB
post your errors
Aug 3 '07 #2
JosAH
11,448 Expert 8TB
Greetings,

I am stuck on a topic for TAFE and cannot get my head around it.

I need to Write a program to use a D to A converter board to output various signals which can be viewed on an oscilloscope.

I have made the Triangle wave, which works, but am stuck on the sine wave.

Code for sine wave thus far is:



It will not compile and I keep getting errors. I think the problem lies within the last line of while the keyboard is hit, perform a break.

Thanks in advance for any help.
'break' is not a function and you don't even want to break out of that loop as long
as there is no key hit yet. Also, I think that the same signal value is sent to that
device for 129 times.

kind regards,

Jos
Aug 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Isidro Vila Verde | last post by:
Greetings, I need to handle signals to close some excel applications that my script open, when the script is killed by another process. My script is a little bit complex, but I wrote just two ...
4
by: Gabriele Bartolini | last post by:
Hi, I am writing an application in C++ on Linux, using threads (this is my first experience with pthreads). The application itself is fine, it is just that I wanted to handle asynchronous...
1
by: Leo Kirch | last post by:
Hello XSLT gurus, i've got a rather difficult problem. Some explanations first. theres a signal oriented xml-file - the graphical represantation looks like: | startsignal (signal00) \...
4
by: maxmagna | last post by:
Hello, I am looking for material that describes how *precisely* UNIX-based signals interact with the normal C++ execution flow of control and guidelines on how to treat signals in an...
11
by: Jackie | last post by:
Hi everyone, I'd like to know when and how signals are used (e.g. SIGFPE, SIGABRT, SIGTERM, SIGSEGV, SIGINT)? Thank you so much.
0
by: Arnaud Debaene | last post by:
Hello all. I've got a bunch of existing, non managed, C++ DLLs that export types with, among other things, public events implemented using the boost::signals library. Now, I need to have...
11
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
2
by: wongjoekmeu | last post by:
Dear All, I have some a program in which I link a static library. The static library has a initialize() and uninitialized() function. Now when I call the initialize function a thread is being...
1
by: catherine0136 | last post by:
Hello. I am pretty new to VB therefore i need guidance on the following : Basically, my circuit board is connected to solar cell and also a power supply(those laboratory DC power supply used in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.