Tuesday 29 March 2016

Sensing a button press




An explanation of a method to use a button. The skech uses pins 7 and 11. Pin 7 is used to sense the input voltage created when the button is either pressed or released. Pin 11 is used to write to the LED.

The arduino sketch is as follows...

int ledpin=11;//define the LED connect to Pin11;
int inpin=7;//define the button connect to Pin7
int val;//val to store the data
void setup()
{
pinMode(ledpin,OUTPUT);//define the LED Pin to OUTPUT;
pinMode(inpin,INPUT);//define the button Pin to INPUT;
}
void loop()
{
val=digitalRead(inpin);//digital read the button pin
if(val==LOW)//if the button pressed;
{ digitalWrite(ledpin,LOW);}//turn off the LED
else
{ digitalWrite(ledpin,HIGH);}//if not pressed, turn on the LED
}

An explanation of the code and a schematic diagram are available.
Further reading about buttons can be found on the Arduino Site Button Page



Monday 7 March 2016

Basic Arduino Development Kit through CSC

Our Wednesday "Activities" group has seen numbers grow an we now have a group of twelve regular Arduino students including some Year 9 students. What will they design and make as they progress through the school?

All of our activities students will receive a basic Arduino development kit like the one shown.

The kit has a range of experiments to lead you through what can be done with Arduino.

The kit contains:
USB Cable(Type B) x1, Printed guide book x1, 5mm Red LED x5, 5mm Green LED x5, 5mm,Yellow LED x5, RGB LED(Common cathode) x2, 220 OHM Resistor x20, 680 OHM resistor x10, 1K Resistor x10, 10K Resistor x10, 470K Resistor x10, 390PF cermic capacitors x2, IN4007 Diode x2, Buzzer x1, Tilt Switch x2, 50K Potentiometer x1, Photoresister sensor x2, LM35 Temperature sensor x1, 4-Digi LED(common cathode) x1, Four Digit Numeric Display(commend cathode) x1, Flame Sensor x1, 1602 LCD Display Module(Blue) x1, 40 Pin 20cm Dule Male Jumper Wire x1, Basic Breadboard x1, 9V Battery Connector x1, Tact Switch x5, Clear Case x1.