30 April 2010

Humour - cartoonbank.com via the New York Times Office Humor





















I do so like wonky humour like this,
hehe :-D

Don't ask me to explain it...

Task 44 - Personal Presentation; Minor Project


Well, that went ok - except for the mistakes!!
Like, those 6 pins on the Arduino board are for
programming; i said they were for connecting
I2C stuff [sigh]..

Never mind, i can always find out how to do that
now - my Minor Project is on I2C EEPROM stuff.

..& i found some really good sites, including



27 April 2010

Humour - Monty Python please take note!


For sheer unadulterated idiocy, the Iranian ayatollah's comment that prompted this sure takes some beating. Does fundamentalism fry your brains?? The man's a cretin!!

I reckon the Iranian regime will self-destruct from people laughing at it..
Read more here

Click on my "pages" to read the NZ Herald report.

I mean.. WTF!!

..AND the results for 'boobquake Monday' are in (guess what!!)..


Task 44 - Personal Presentation..

Well, here i am in bed sick (again!).
It's getting really tedious..
I've tried to upload my presentation to my blog
but i'm not sure if it'll work..

Nope, didn't work..


22 April 2010

Week 8 - Lab 1: External Interrupts

Setting Up the Interrupts

/*
* Project: Week-08_Lab-1_ExternalInterrupts
* Author: Jane-Maree Howard
* Date: Monday 18/04/2010
* Platform: Arduino 18
* Purpose: To do nothing apart from demonstrating ISRs
(Interrupt Service Rountines).
For each of the 2 interrupt lines (0 & 1), its ISR
outputs a string to the Serial Monitor which identifies
the interrupt line number to which the ISR is attached
*/
const int buttonPin = 2; // Interrupt 0 - pushbutton pin
const int otherPin = 3; // Interrupt 1 - 'somethingElse' pin

void setup()
{
Serial.begin(9600);
// initialise Digital Pins
pinMode(buttonPin, INPUT);
pinMode(otherPin, INPUT);
// attach Interrupts
attachInterrupt(0, SM_Output_0, LOW);
attachInterrupt(1, SM_Output_1, LOW);
}//setup()

void loop()
{
}//loop()

/* Interrupt Service Routines */
// Output 0
void SM_Output_0()
{
Serial.println("\tInterrupt on line 0 - LOW\n");
}//SM_Output_0()

// Output 1
void SM_Output_1()
{
Serial.println("\tInterrupt on line 1\n");
}//SM_Output_1()

Task 45 - InfraRed LED & detector

Well, i Don't Have (or Can't Find) my IR LED(s)!
I thought i had one/some, but they just glow a sickly green - is that them??

I now have a breadboard arrangement that's SUPPOSED to detect an IR flash & transmit that to an IR detector, but i've got my wiring mixed up
& it's NOT working..

I need to think more about the breadboard, coz i think the software's ok.

[siiiigh]

19 April 2010

Task 44 - Personal presentation topic, again!

Haven't exactly been hyper-active over the Easter break, but i Have Finished my presentation.
A bit more elaborate than some i've seen, probably too long..

..but i had all this extra time & i needed to do something (apart from looking at Tim G's new version of his 60-second Digital Timer - he's really done some work on it & i haven't got it sussed yet).

The alternative was schlepping around on the Web looking for YooHoo-Tubes & the like (sigh)- i just don't get enthused at all by that stuff, not least because i STILL haven't up-graded my 'puter's RAM yet, & it desperately needs it (bigger sigh)..

..& of course some of the Tasks require the above schlepping - it's like when i was ferreting around in Electronics magazines: i didn't actually Need the circuits i found in there; whenever i needed something i just made stuff up! & they worked, not a problem - though i spose it would've been for Really Complicated Stuff..

..it's late, as in Stupid O'clock Monday morning & i've had enough for the time being. Hope the weather's not Too miserable later on..

07 April 2010

Task 44 - Personal presentation topic: Arduino Memory


I'm going to be examining the Duemilanove with its Atmega328 microcontroller.

I'm actually learning about this thing as i'm going along so i don't mind (& normally i DO mind!) making this PowerPoint about it, & especially the add-on bits like the
24LC256 EEPROM chip, with its I2C innards & its up-to-8-chips extendability - very attractive feature for anyone wanting to hang onto large amounts of data..

Gotta go, be late for a meeting & i'm HUNGRY (as usual)..

03 April 2010

What I found in the back room @ Stupid-o'clock on Friday moring..


Well i'd had quite a productive day messing around with that teeny-weensy breadboard that came with my Kit, but i was quite sure i had an old one somewhere among the Stuff I Had Accumulated Over The Years..
Question: had my Uber-Tidy sister thrown it out because she didn't know what it was (ipso facto it Must Be Junk), or squirrelled it away under a mountain of Other Stuff she deemed More Relevant To My Life???
After a little thought i decided she might've learned that if it looked electronically unfamiliar, best she leave it in a corner somewhere.. Pretty much where i found the following:
Breadboard (4xlittle green MindKit size),
74 series TTL chips (the rugged non-fluffy-non-delicate-non-CMOS kind),
Half-a-squillion resistors & other odds-&-sods,
Some CMOS chips (still in anti-static foil, as yet Unk-Unk),
Even-More-Strip-backed-perf-board than i ever recalled having (YAY shields!!),
Connecting wire of various colours,
Solder,
Transistors, diodes, what-look-like li'l bitty voltage Regulators..
And-So-On.. quite a little treasureTrove!!
However, i suspect another of my sisters has my 15W soldering iron, so i'll probably neverEver see THAT again (or if i do, it'll be broken/karked/burntOut)..

Never Mind, Mabel !! So far, so encouraging!

01 April 2010

Arduino KEYWORDS(4)


Arrays

An array is a collection of variables
that are accessed with an index number.
Arrays in the C programming language,
on which Arduino is based, can be complicated,
but using simple arrays is relatively straightforward.

Creating (Declaring) an Array

All of the methods below are valid ways to create (declare) an array.

  int myInts[6];
int myPins[] = {2, 4, 8, 3, 6};
int mySensVals[6] = {2, 4, -8, 3, 2};
char message[6] = "hello";

You can declare an array without initializing it as in myInts.

In myPins we declare an array without explicitly choosing a size.
The compiler counts the elements and creates an array of the appropriate size.

Finally you can both initialize and size your array, as in mySensVals.
Note that when declaring an array of type char,
one more element than your initialization is required,
to hold the required null character.

Accessing an Array

Arrays are zero indexed, that is, referring to the array initialization above,
the first element of the array is at index 0,
hence


mySensVals[0] == 2, mySensVals[1] == 4,
and so forth.

It also means that in an array with ten elements, index nine is the last element.
Hence:

int myArray[10]={9,3,2,4,3,2,7,8,9,11};
// myArray[9] contains 11
// myArray[10] is invalid and contains random information
// (other memory address)

For this reason you should be careful in accessing arrays.
Accessing past the end of an array
(using an index number greater than your declared array size - 1)
is reading from memory that is in use for other purposes.
Reading from these locations is probably not going to do much except yield invalid data.
Writing to random memory locations is definitely a bad idea
and can often lead to unhappy results such as crashes or program malfunction.
This can also be a difficult bug to track down.

Unlike BASIC or JAVA, the C compiler does no checking to see
if array access is within legal bounds of the array size that you have declared.

To assign a value to an array:

mySensVals[0] = 10;

To retrieve a value from an array:

x = mySensVals[4];

Arrays and FOR Loops

Arrays are often manipulated inside for loops,
where the loop counter is used as the index for each array element.
For example, to print the elements of an array over the serial port,
you could do something like this:

int i;
for (i = 0; i < i =" i">

Example
For a complete program that demonstrates the use of arrays,
see the Knight Rider example from the Tutorials.



Integer Constants

Integer constants are numbers used directly in a sketch, like 123.
By default, these numbers are treated as int's
but you can change this with the U and L modifiers (see below).

Normally, integer constants are treated as base 10 (decimal) integers,
but special notation (formatters) may be used to enter numbers in other bases.

Base               Example    Formatter        Comment

10 (decimal) 123 none

2 (binary) B1111011 leading 'B' only works with 8 bit values (0 to 255)
characters 0-1 valid

8 (octal) 0173 leading "0" characters 0-7 valid

16 (hexadecimal) 0x7B leading "0x" characters 0-9, A-F, a-f valid

Decimal is base 10.
This is the common-sense math with which you are acquainted.
Constants without other prefixes are assumed to be in decimal format.

Example:
101     // same as 101 decimal   ((1 * 10^2) + (0 * 10^1) + 1)


Binary is base two.
Only characters 0 and 1 are valid.

Example:
B101    // same as 5 decimal   ((1 * 2^2) + (0 * 2^1) + 1)

The binary formatter only works on bytes (8 bits)
between 0 (B0) and 255 (B11111111).
If it is convenient to input an int (16 bits) in binary form
you can do it a two-step procedure such as:

myInt = (B11001100 * 256) + B10101010;    // B11001100 is the high byte

Octal is base eight.
Only characters 0 through 7 are valid.
Octal values are indicated by the prefix "0"

Example:

0101    // same as 65 decimal   ((1 * 8^2) + (0 * 8^1) + 1)
Warning
It is possible to generate a hard-to-find bug by (unintentionally)
including a leading zero before a constant
and having the compiler unintentionally interpret your constant
as octal.


Hexadecimal (or hex) is base sixteen.
Valid characters are 0 through 9 and letters A through F;
A has the value 10, B is 11, up to F, which is 15.
Hex values are indicated by the prefix "0x".
Note that A-F may be typed in upper or lower case (a-f).

Example:

0x101   // same as 257 decimal   ((1 * 16^2) + (0 * 16^1) + 1)

U & L formatters

By default, an integer constant is treated as an int
with the attendant limitations in values.
To specify an integer constant with another data type,
follow it with:

  • a 'u' or 'U' to force the constant into an unsigned data format.
    Example: 33u
  • a 'l' or 'L' to force the constant into a long data format.
    Example: 100000L
  • a 'ul' or 'UL' to force the constant into an unsigned long constant.
    Example: 32767ul

Experiment with using 'int' variables in place of HIGH/LOW

/*
* Project: Experiment#1_simpleBlink
* Author: Jane-Maree Howard
* Date: Thursday 01/04/2010
* Platform: Arduino 18
* Purpose: To demonstrate variables in digitalWrite()
* Operation: Sets up output pin 13 in setup() method;
* Declares pin definition variable, delay variable, pin value variable
* Defines loop() to perform various LED blinking operations
*/

int ledPin = 13; // on-board LED connected to digital pin 13
int dLay = 250; // delay variable
int pinVal = 1; // pinVal = 1/0, == HIGH/LOW
int j;
int iFlash = 10; //flashing counter
// The setup() method runs once, when the sketch starts
void setup()
{
// initialize digital pin 13 as output
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, pinVal); // turn on-board LED on
}//end setup()

void loop()
{
//flashing sequence
for (j=0; j {
if (pinVal == 1) //if LED is ON..
pinVal = 0; //..turn it OFF..
else //..or if LED is OFF..
pinVal = 1; //..turn it ON
//now write to on-board LED
digitalWrite(ledPin, pinVal);
delay(50);
}//end for(j++) flash
//delay 1 second
delay(4*dLay);
digitalWrite(ledPin,LOW);
/* Above, I could have written
pinVal = 0;
digitalWrite(ledPin,pinVal);
and it would've produced the same result.
This technique enables more flexible manipulation of
'digitalWrite()' statements because you can set up your
parameter values in advance using, e.g. various 'if()'
statements then writing the parameter values to a single
'digitalWrite()' statement rather than having a whole
raft of them cluttering up your program (& gobbling up
excessive numbers of Bytes!) */

}//end loop()