Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

How can you add or subract value from a variable???

$
0
0

Can anyone explain why the long variable 'frequency' will not change based on pin status?  (loop function)  I know I must be doing something wrong but I can't seem to figure it out.  The program as written works.  I type in for example 7000000 and the DDS programs to 7.0 Mhz.  If a pin is pulled low I want to add or subtract 1500.  But that part does not work.  It always sets the DDS to the input frequency.  I've added print statements to verify what is happening and I know the program is detecting pin state OK. so something is wrong with my logic for adding or subtracting.

 

 

file attached:

Attached Files


Viewing all articles
Browse latest Browse all 2077

Trending Articles