ROBOTC.net forums
http://www.robotc.net/forums/

NOR gate for RobotC
http://www.robotc.net/forums/viewtopic.php?f=32&t=6522
Page 1 of 1

Author:  jtech452 [ Wed Aug 14, 2013 9:02 pm ]
Post subject:  NOR gate for RobotC

Does robotc have an implementation of the NOR or NAND or NOT logic gates?

Thanks!

-JTech452

Author:  NeXT-Generation [ Wed Aug 14, 2013 9:08 pm ]
Post subject:  Re: NOR gate for RobotC

How so? As in an if(){} statement?

Author:  Ernest3.14 [ Wed Aug 14, 2013 9:19 pm ]
Post subject:  Re: NOR gate for RobotC

!= 8)

Edit: See what I did there?

Author:  mattallen37 [ Wed Aug 14, 2013 10:18 pm ]
Post subject:  Re: NOR gate for RobotC

Code:
z = (!(x || y)) // z = x NOR y
z = (!(x && y)) // z = x NAND y
z = (!(x)) // z = NOT x

Author:  jtech452 [ Mon Aug 19, 2013 4:14 pm ]
Post subject:  Re: NOR gate for RobotC

@mattalelen37 Thanks! That answers it.

@NeXT Generation Yes, in an if statement. Specifically referring to detecting if neither of two buttons are pressed on the joypad controller)

@Ernest3.14 No, I have no Idea what you did there.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/