View unanswered posts | View active topics It is currently Sun Sep 14, 2014 10:02 pm






Reply to topic  [ 8 posts ] 
(maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at GND 
Author Message
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post (maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at GND
Setting SensorValue[dgtlPin] = 0; DOES NOT make that pin GND. Connecting a LED anode to, say, pin 13 and setting it to "1", with cathode at pin 12 set to "0" should turn the LED on, but it doesn't! Connecting the LED anode to a pin set to "1" and cathode to GND pin works, but not a pin set to "0". This is absolutely required for my project! Please fix!

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Last edited by NeXT-Generation on Wed May 16, 2012 9:26 am, edited 1 time in total.



Tue May 15, 2012 10:13 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Bug Report: SensorValue[dgtlX] = 0 not at GND
You have to set the pins to "Digital High Impedance" for that to work. Be aware that you'll be disabling the internal pull-up resistor.
*EDIT: Misread question.

_________________
sudo rm -rf /


Tue May 15, 2012 10:50 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Bug Report: SensorValue[dgtlX] = 0 not at GND
Oh, okay. I wouldn't have thought that. Isn't that the opposite of most software? I use HIGH/LOW (or 1/0) like that with the BASIC Stamp, and standard AVR. The term "high impedance" seems to indicate that the current is resisted, doesn't it?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Tue May 15, 2012 10:56 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Bug Report: SensorValue[dgtlX] = 0 not at GND
My apologies, I misread your question. What you're describing works fine for me though. I can have an LED light up by sourcing from one pin and sinking into another.

_________________
sudo rm -rf /


Tue May 15, 2012 11:22 pm
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: (maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at
Can I see your code for that? Neither of them are working for me. I must be doing it wrong, then. I'm trying to use a 3-digit 7-segment common anode LED display. Dots not used. It's kinda old, but I know it still works. As a starter project, I wanted to make a "simon" game and I want to use this display to show how many patterns you've gotten.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Wed May 16, 2012 9:30 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: (maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at
Not much code to show. This will make the LED blink regardless of which pin you connect to the anode or cathode.
Code:
while(true)
  {
    SensorValue[dgtl11] = 1;
    SensorValue[dgtl12] = 0;
    wait1Msec(200);
    SensorValue[dgtl11] = 0;
    SensorValue[dgtl12] = 1;
    wait1Msec(200);
  }


_________________
sudo rm -rf /


Wed May 16, 2012 10:51 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: (maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at
Ohhhh, I get it now. Both pins should be set to "digital out", and one be set to "0" and the other to "1". I got it to work. Thanks!

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Wed May 16, 2012 11:00 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: (maybe a bug? not sure.) SensorValue[dgtlX] = 0 not at
Oh, I just assumed you had them configured as digital outs. I should have specified.

_________________
sudo rm -rf /


Wed May 16, 2012 11:10 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.