Git Product home page Git Product logo

robots-miniracecar's Introduction

robots-miniRaceCar

Based on the Adafruit MyMiniRaceCar

https://learn.adafruit.com/my-mini-race-car/how-your-robot-works-the-basics?view=all

https://www.pololu.com/product/961

Installing microPython on the Huzzah32

The came with a Bluefruit M0 microcontroller board. I replaced that with the ESP32 Huzzah board.

I installed micropython:

https://learn.adafruit.com/micropython-basics-how-to-load-micropython-on-a-board/esp8266

http://docs.micropython.org/en/latest/esp8266/esp8266/tutorial/intro.html#deploying-the-firmware

C:\Python27\Scripts>esptool --port COM7 erase_flash

esptool.py --chip esp32 --port /dev/ttyUSB1 write_flash -z 0x1000 c:\users\tophe\Desktop\esp32-20170902-v1.9.1-477-g75ead22c.bin

I2C on ESP32

from machine import Pin, I2C

esp32i2cPins = {'sda': 23, 'scl': 22}
frequency=100000

sclPin=esp32i2cPins['scl']
sdaPin=esp32i2cPins['sda']
i2c = I2C(scl=Pin(sclPin), sda=Pin(sdaPin), freq = frequency)
        
devices = i2c.scan()
print(devices)  

# Talking to the MCP9808 temperature sensor

address = 24
temp_reg = 5
res_reg = 8

data = i2c.readfrom_mem(address, temp_reg, 2)
print(data)

The Motor FeatherWing

Product details: https://learn.adafruit.com/adafruit-stepper-dc-motor-featherwing

Micropython tutorial: https://learn.adafruit.com/micropython-hardware-pca9685-dc-motor-and-stepper-driver?view=all

Note this is the same chip and communication with the arduino board

from machine import Pin, I2C

esp32i2cPins = {'sda': 23, 'scl': 22}
frequency=100000

sclPin=esp32i2cPins['scl']
sdaPin=esp32i2cPins['sda']
i2c = I2C(scl=Pin(sclPin), sda=Pin(sdaPin), freq = frequency)

import motor
import time

motors = motor.DCMotors(i2c)

motors.speed(2,2000)
motors.speed(3,2000)

time.sleep(2)

motors.brake(2)
motors.brake(3)

robots-miniracecar's People

Contributors

tophercantrell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.