#define LED 12 // LED
#define HALL 8 // hall effect sesnor
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(HALL, INPUT);
}
void loop() {
if(digitalRead(HALL)==HIGH) {
digitalWrite(LED, LOW); // turn LED off
Serial.println("OFF");
}
else {
digitalWrite(LED, HIGH); // turn LED on
Serial.println("ON");
}
}
0 Comments
#include <Adafruit_NeoPixel.h> How to set up your computer: 1. Go to System Preferences -> Click "Sharing" -> Turn on Internet Sharing from Wifi to Ethernet 2. Open the ethernet shield's library -> Open the example to find the IP address of your internet (the following code is adapted from the internet) - on the webpage: 0 means its fully on (no resistance); 255 means turned off (full resistance) ** the webpage is : http:// x.x.x.x/rgb (x.x.x.x = IP address) #include "SPI.h" |
Categories
All
|