MJRoBot (Marcelo Rovai)
Published © GPL3+

The "Mars Rover" Emulator

A functional mobile prototype, a "Rover Station”, responsible for environmental data capture as Temperature, Humidity and Luminosity.

IntermediateFull instructions provided2 days17,814
The "Mars Rover" Emulator

Things used in this project

Story

Read more

Schematics

Mars Roover

Code

Code snippet #1

Plain text
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)

a_pin = 25
b_pin = 23

def discharge():
    GPIO.setup(a_pin, GPIO.IN)
    GPIO.setup(b_pin, GPIO.OUT)
    GPIO.output(b_pin, False)
    time.sleep(0.005)

def charge_time():
    GPIO.setup(b_pin, GPIO.IN)
    GPIO.setup(a_pin, GPIO.OUT)
    count = 0
    GPIO.output(a_pin, True)
    while not GPIO.input(b_pin):
        count = count + 1
    return count

def analog_read():
    discharge()
    return charge_time()

while True:
    print(analog_read())
    time.sleep(1)

Code snippet #2

Plain text
from twython import Twython

C_KEY = "xxxxxxxxxxxx"

C_SECRET = "yyyyyyyyy"

A_TOKEN = "zzzzzzzzzzzz"

A_SECRET = "wwwwwwwww"

api = Twython(C_KEY, C_SECRET, A_TOKEN, A_SECRET)

api.update_status(status="IoT Capstone Project - Tweet test")

Code snippet #3

Plain text
#include 
Servo leftServo;
Servo rightServo;

Void setup()
{
  leftServo.attach(6);
  rightServo.attach(5);
  leftServo.writeMicroseconds(1500);
  rightServo.writeMicroseconds(1500);
}

void loop()
{
}

Github

https://github.com/miguelgrinberg/flask-video-streaming.git

Github

https://github.com/adafruit/Adafruit_Python_DHT.git

Github

https://github.com/Mjrovai/MJRoBot-Mars-Rover

Credits

MJRoBot (Marcelo Rovai)

MJRoBot (Marcelo Rovai)

66 projects • 956 followers
Professor, Engineer, MBA, Master in Data Science. Writes about Electronics with a focus on Physical Computing, IoT, ML, TinyML and Robotics.

Comments