# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from __future__ import division # to handle floating poitn division import sys sys.path.insert(0, 'C:\Users\Erik Wilhelm\Documents\GitHub\eBot-API' ) #Insert your directory for the eBot-API here from eBot import * #Create new instance of eBot - connects to first eBot the computer is connected to myEBot = eBot() myEBot.connect() myEBot.halt() # wait before entering loop sleep(1) ArcString = input( "Enter an integer number of iterations to move in a cicle (200 works well): " ) t_run = int(ArcString) #number of loop iterations (not seconds) to run for RadString = input( "Enter an integer number to describe the radius of curvature (ratio between wheel speeds)(2 works well): " ) rad = int(RadString) DirStr = input( "Enter 'Clk' to inscribe a clockwise circle, 'CClk' for counterclockwise: "
from eBot import * import time myEBot = eBot() myEBot.connect() print myEBot.power() myEBot.wheel_calibrate(990,1000) def Movement(value,r_time): wheel_speed = value myEBot.wheels(wheel_speed, wheel_speed) now_time = time.time() while (time.time() < now_time + r_time ): print (myEBot.robot_uS()).__str__().replace('[',' ').replace(']',' ') #print (myEBot.position()).__str__().replace('[',' ').replace(']',' ') sleep(0.05) myEBot.halt() def main(): for num in range(100): value =input("Enter the rotational speed of the eBot: ") r_time = input("Enter the time you want eBot to rotate: ") Movement(value,r_time) myEBot.close() main()
def __init__(self): self.mybot = eBot()
from eBot import * import time myBot = eBot() myBot.connect() myBot.led(1) myBot.wheels(-0.1, 0.1) time.sleep(5) myBot.led(0) myBot.halt() myBot.close()
from eBot import * import time myBot = eBot() myBot.connect() myBot.led(1) myBot.wheels(-0.1,0.1) time.sleep(5) myBot.led(0) myBot.halt() myBot.close()