View Single Post
  #6   Spotlight this post!  
Unread 25-02-2004, 11:28
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: Using a switch to control a PWM

Quote:
Originally Posted by Mark McLeod
You have the general idea, however, the joystick buttons have a value of "1" by default, and switch to "0" when pressed. You may be confusing your test by having the later switch override the first switch test.
Try a simpler test like:
Code:
if (p2_sw_trig)
pwmxxx = 254;
else
pwmxxx = 0;
0 does not evaluate to true - it is the only integer that evaluates to false. the joystick buttons have a value of 0 by default, not 1.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)