Skip to content

Instantly share code, notes, and snippets.

View schappim's full-sized avatar
💤
Sleeping . +10GMT

Marcus S schappim

💤
Sleeping . +10GMT
View GitHub Profile
@schappim
schappim / button-led.ino
Last active August 11, 2018 02:03
Turning no an LED with the ThinkerShield
int buttonState = 0;
int randomNumber = 0;
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
#include <MeMCore.h>
MeBuzzer buzzer;
MeLineFollower lineFinder(PORT_2);
MeDCMotor motor1(M1); //Motor1 is Left Motor
MeDCMotor motor2(M2); //Motor2 is Left Motor
MeRGBLed led(0, 30);
void setup() {
led.setpin(13);
@schappim
schappim / download_images.rb
Last active July 10, 2018 00:38
download_the_image_files.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'nokogiri'
# Set the URL of the page we want to scrape
url = "https://www.kitronik.co.uk/5632-klip-halo-for-the-bbc-microbit.html"
# Download the webpage
@schappim
schappim / get_the_href.rb
Created July 10, 2018 00:21
Get the Image Link hrefs
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'nokogiri'
# Set the URL of the page we want to scrape
url = "https://www.kitronik.co.uk/5632-klip-halo-for-the-bbc-microbit.html"
# Download the webpage
@schappim
schappim / get_image_links.rb
Created July 10, 2018 00:09
Get Image Links
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'nokogiri'
# Set the URL of the page we want to scrape
url = "https://www.kitronik.co.uk/5632-klip-halo-for-the-bbc-microbit.html"
# Download the webpage
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'nokogiri'
# Set the URL of the page we want to scrape
url = "https://www.kitronik.co.uk/5632-klip-halo-for-the-bbc-microbit.html"
# Download the webpage
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'nokogiri'
# Set the URL of the page we want to scrape
url = "https://www.kitronik.co.uk/5632-klip-halo-for-the-bbc-microbit.html"
# Download the webpage
const int buzzer = 9; //buzzer to arduino pin 9
void setup() {
pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
}
void loop() {
@schappim
schappim / multiple-timers.ino
Last active May 11, 2018 22:57
Arduino Multiple Timers
/*
Copyright 2018 Brian Mudd
I hear of a lot of people trying to set up multiple timers in their sketches.
I find the following works very well. It uses the same principle as industrial PLC's.
This allows any number of timers with a resolution of 0.1s and time out values up to 109 minutes
(cascading timers for longer values).
*/