Making Robots

Hi, I'm Chris

We'll cover

hardware you'll need

software you'll write

creative uses you'll find

Hardware

Tessel

Arduino

Supported Languages

JavaScript

C++

Ways to program

C++, compile, upload

Firmata

Let's give it a go!

Sometimes circuits

get complex...

Resistor

Diode

Transistor

medium.com/@assertchris/20bfc59004bd

Let's write some code!

Works well with Aerys

$services = new SplQueue();

$services->enqueue(
    new Notifier\Service\Twitter(
        getenv("SERVICE_TWITTER_CONSUMER_KEY"),
        getenv("SERVICE_TWITTER_CONSUMER_SECRET"),
        getenv("SERVICE_TWITTER_ACCESS_TOKEN"),
        getenv("SERVICE_TWITTER_ACCESS_TOKEN_SECRET")
    )
);

$services->enqueue(
    new Notifier\Service\Gmail(
        getenv("SERVICE_GMAIL_USERNAME"),
        getenv("SERVICE_GMAIL_PASSWORD")
    )
);
$loop->setInterval(function() use ($loop, $board, $services) {
    $current = null;

    foreach ($services as $service) {
        if ($service->hasNotifications()) {
            $current = $service;
            break;
        }
    }

    $colors = $current->colors();

    $board->pins[10]->analog = $colors[0];
    $board->pins[11]->analog = $colors[1];
    $board->pins[9]->analog = $colors[2];

    $loop->setTimeout(function() use ($board) {
        $board->pins[10]->analog = 1;
        $board->pins[11]->analog = 1;
        $board->pins[9]->analog = 1;
    }, 1000 * 2);
}, 1000 * 5);
$loop->setInterval(function() use ($board, $current) {
    if ($board->pins[14]->analog < 0.1) {
        $current->clearNotifications();
    }
}, 50);

sitepoint.com/home-made-twitter-and-gmail-notifications-with-php-and-arduino

sitepoint.com/php-arduino-and-minecraft-connecting-an-arduino-to-php

So, what's the point?

Thanks

joind.in/talk/44531

slides.com/assertchris

 

twitter.com/assertchris

youtube.com/assertchris

Building Robots with PHP

By Christopher Pitt

Building Robots with PHP

  • 1,102
Loading comments...

More from Christopher Pitt