Twitter en lumière
Sommaire
Introduction
Les bases du code
Allumons la lumière
Un peu de logique
Connexion avec Twitter
L'envoi de SMS
#Canal +
#simplon
Raspberry Pi
Micro-ordinateur
HDMI
USB
Ethernet
MicroSD
GPIO
700 Mhz
512 Mo
Ruby
irb
puts("Bonjour Canal +")
name = "Canal"
puts("Bonjour " + name)
name = "simplon"
puts("Bonjour " + name)
name.upcase()
load "led.rb"
Led.orange()
Led.red()
Led.blue()
Led.pink()
Led.green()
Led.yellow()
Led.orange()
?
Bonjour
Holla
Hello
country = "France"
if country.include("france")
puts("Bonjour")
end
country = "England"
if country.include("France")
puts("Bonjour")
else
puts("Hello")
end
if country.include("France ")
puts("Bonjour")
elsif country.include("Spain")
puts("Holla")
else
puts("Hello")
end
countries = ["France", "Mali", "Sénégal"]
country = "Mali"
if country.include(countries)
puts("Bonjour")
end
Twitter.when(["#canal+"]) do |tweet|
puts(tweet)
end
Twitter.when(["#canal+", "#simplon"]) do |tweet|
puts tweet
if tweet.include(["#orange"])
Led.orange()
end
end
Twitter.when(["#canal+", "#simplon"]) do |tweet|
puts tweet
if tweet.include(["#orange"])
Led.orange()
else
Led.red()
end
end
load "sms.rb"
Twitter.when(["#orange", "#simplon"]) do |tweet|
puts tweet
if tweet.include(["#orange"])
Led.orange()
Sms.send("+33650174288", tweet)
else
Led.red()
end
end
Merci
Made with Slides.com