Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
Asked — Edited

Getdigital() Function Sets Digital Port On Rendering It Useless

getdigital() function sets digital port on rendering it useless.

Tried on different boards. Will try from a different computer but if anyone has the same bug, please let me know.

Updated EZbuilder to last version.

Thanks,

Elfege


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a cool new tool that will help unleash your creativity with programming robots in just seconds!

PRO
Synthiam
#1  
Can you explain this message please?

Are you stating that when you get digital, the port is now in a digital read state? As the name implies? More information is necessary.

If this helps, it's worth knowing that a microcontroller pin on any chip in existence can only be in one peripheral state at a time...

Those states are either input or output, hence the I/o. The abbreviation of I/o stands for input output. You can find out more in the ezb tutorial where port types are explained, including what adc and serial is...

If your code reads a digital port, it becomes input and floats the output. So, if you set a digital port value and then read from the digital port, you lose the value for that reason.
#2  
If i try to read the value of a port that is on low mode, the port switches to high , exactly ly as if getdigital(D8) was a set(d8,on).
PRO
Synthiam
#3  
It switches to FLOAT - which may appear "high" because it's floating. Floating means it will conduct static electricity and any voltage on the wire. If you wish to check for an input, ensure the device connected has a resistor to high or low, based on the desired state.

In this case, the resistor would be referred to as a pull-up or pull-down.

Here's some search results for assistance:

1) how to wire a button
http://www.ez-robot.com/Community/Forum/Thread?threadId=5834

2) ADC Ports (i know this is adc and not digital, but the same method applies)
http://www.ez-robot.com/Community/Forum/Thread?threadId=8808

Lastly, if you're switching the port type programatically, expect issues. For example, if you're using the port as a servo and use a GetDigital(), that won't work. If you're the port with Set() and then GetDigital(), that won't work. This is because you've configured the port for a specific peripheral and attempting to perform a command that is not supported by that peripheral.