Jump to content

Recommended Posts

Posted (edited)
	hub = MSHub()
	mp = MotorPair( 'A' , 'B' )
	mp.set_default_spped( 50 )
	mp.move( 2 , "rotations' , steering = 0 )
	#roations can also be degrees or seconds
	
Edited by bluatigro
Posted

	#create objects
	dist = DistanceSensor( 'E' )
	color = ColorSensor( 'F' )
	#read examples
	darkness = color.get_reflected_light()
	color.wait_for_color( 'red')  
	dist.wait_for_distance_closer_then( 10 , 'cm' )
	hub.moition_sensor.wait_for_new_gesture( 'tapped' )
	

Posted

Hi I 'm  not sure what youe are looking for

But yout find lots of descriptions and examples (also transscription from Scratch into python) within the mindstorms software?

You click on the "book"-symbol  on the most right of the screen.

 

Posted

But you showed some python code here?

Anyway:

In the menu bar you have the home-symbol, an open scratch project and a "+" sign

Click on "+", choose python, then you have a python project and the book symbol.

  • 1 month later...
Posted (edited)

I'm currently working on implementing all the 51515 base projects in Python. You can find the code in my GitHub repository. It is work in progress and not all of them are done (far from it - just started with Charlie). However, I plan to keep working on them on my free time. Feel free to take a look around. Feedback is always welcome!

Edited by arturomoncadatorres
Posted
2 hours ago, arturomoncadatorres said:

I'm currently working on implementing all the 51515 base projects in Python. You can find the code in my GitHub repository. It is work in progress and not all of them are done (far from it - just started with Charlie). However, I plan to keep working on them on my free time. Feel free to take a look around. Feedback is always welcome!

Why don't you just download the example projects to the hub and then upload them back to the computer with a tool like rshell? With the current mindstorms app version, all scratch programs are stored on the hub in plain python text.

Posted
17 minutes ago, Tcm0 said:

Why don't you just download the example projects to the hub and then upload them back to the computer with a tool like rshell? With the current mindstorms app version, all scratch programs are stored on the hub in plain python text.

That's interesting, I didn't know that. Originally, I was doing this as a learning exercise (and hopefully to make it useful to other people starting with (Micro)Python). Nevertheless, I might look into this in the future. Thanks!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...