This code extract to wait for a button on portc.0,1,2 tied low to go high doesn't work but testing buttons if on is fine. Masking a port like this works on a pic. Please tell me what I'm doing wrong.
#chip mega328p, 16 #include <UNO_mega328p.h > #option explicit #define left_button portc.0 ;cannon buttons #define right_button portc.1 #define fire_button portc.2 dir left_button in dir right_button in dir fire_button in ; do temp=(portc and 7) ;ALWAYS ZERO glcdprint 0,32,temp ; Randomize loop until (portc and 7)>0 ;HELP
I remember updating the Help page for you. See http://gcbasic.sourceforge.net/help/_inputs_outputs.html
avr sometimes use pinc
do randomise loop until (pinc and 7)>0
yet, if portc.1=1 then...works ok pin is not in include <uno_mega328p.h></uno_mega328p.h>
Log in to post a comment.
This code extract to wait for a button on portc.0,1,2 tied low to go high doesn't work but testing buttons if on is fine.
Masking a port like this works on a pic. Please tell me what I'm doing wrong.
I remember updating the Help page for you. See http://gcbasic.sourceforge.net/help/_inputs_outputs.html
avr sometimes use pinc
yet, if portc.1=1 then...works ok
pin is not in include <uno_mega328p.h></uno_mega328p.h>