| Author |
Message |
|
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 528 Location: Totally not spying on Hassenplug to see what he has for the Brickworld Chicago 2013 sumo contest.
|
 (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 |
|
 |
|
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 496
|
 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 |
|
 |
|
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 528 Location: Totally not spying on Hassenplug to see what he has for the Brickworld Chicago 2013 sumo contest.
|
 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 |
|
 |
|
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 496
|
 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 |
|
 |
|
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 528 Location: Totally not spying on Hassenplug to see what he has for the Brickworld Chicago 2013 sumo contest.
|
 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 |
|
 |
|
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 496
|
 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.
_________________ sudo rm -rf /
|
| Wed May 16, 2012 10:51 am |
|
 |
|
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 528 Location: Totally not spying on Hassenplug to see what he has for the Brickworld Chicago 2013 sumo contest.
|
 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 |
|
 |
|
magicode
Moderator
Joined: Tue Sep 14, 2010 9:19 pm Posts: 496
|
 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 |
|
|