Programming and Interfacing with Arduino 1st Edition Yogesh Misra download
Programming and Interfacing with Arduino 1st Edition Yogesh Misra download
https://ebookmeta.com/product/programming-and-interfacing-with-
arduino-1st-edition-yogesh-misra/
https://ebookmeta.com/product/programming-arduino-getting-
started-with-sketches-third-edition-simon-monk/
https://ebookmeta.com/product/arduino-a-beginners-guide-to-
arduino-programming-1st-edition-george-gibson/
https://ebookmeta.com/product/arduino-arduino-user-guide-for-
operating-system-programming-projects-and-more-2nd-edition-
robert-scott/
https://ebookmeta.com/product/fundamentals-of-machine-component-
design-7th-edition-robert-c-juvinall/
China s Belt and Road Vision Geoeconomics and
Geopolitics S Mahmud Ali
https://ebookmeta.com/product/china-s-belt-and-road-vision-
geoeconomics-and-geopolitics-s-mahmud-ali/
https://ebookmeta.com/product/love-me-harder-welcome-to-cupids-
cove-1st-edition-m-k-moore/
https://ebookmeta.com/product/rising-up-living-on-re-existences-
sowings-and-decolonial-cracks-1st-edition-catherine-e-walsh/
https://ebookmeta.com/product/the-philosophy-of-social-science-
new-perspectives-2nd-edition-garry-potter-2/
https://ebookmeta.com/product/she-speaks-her-anger-myths-
conversations-of-gimi-women-a-psychological-ethnography-in-the-
eastern-highlands-of-papua-new-guinea-1st-edition-gillian-
Mastering Java: A Beginner's Guide 1st Edition Sufyan
Bin Uzayr
https://ebookmeta.com/product/mastering-java-a-beginners-
guide-1st-edition-sufyan-bin-uzayr/
Programming and
Interfacing with Arduino
Programming and
Interfacing with Arduino
Reasonable efforts have been made to publish reliable data and information, but the author and
publisher cannot assume responsibility for the validity of all materials or the consequences of
their use. The authors and publishers have attempted to trace the copyright holders of all material
reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and
let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced,
transmitted, or utilized in any form by any electronic, mechanical, or other means, now known
or hereafter invented, including photocopying, microfilming, and recording, or in any information
storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.
com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA
01923, 978-750-8400. For works that are not available on CCC please contact m
pkbookspermissions@
tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are
used only for identification and explanation without intent to infringe.
Typeset in Times
by codeMantra
Contents
Preface.......................................................................................................................xi
Acknowledgments .................................................................................................. xiii
Author ...................................................................................................................... xv
Abbreviations Used in This Book ..........................................................................xvii
v
vi Contents
2.2.3 digitalRead(pin)................................................. 18
2.2.4 analogRead(pin) .................................................. 19
2.2.5 analogWrite(pin, value) ................................20
2.2.6 delay(value) .........................................................20
2.2.7 for loop ..................................................................... 21
2.2.8 Serial.begin(rate) ............................................ 21
2.2.9 Serial.print(“argument”) ............................... 21
2.2.10 Serial.println(“argument”) .......................... 21
2.2.11 if statement ............................................................... 22
2.2.11.1 Simple if.................................................... 22
2.2.11.2 if/else ..................................................... 23
2.2.11.3 Multiple if/else.......................................24
2.2.12 map function...............................................................25
BOOK ORGANIZATION
This book starts with the explanation of Arduino UNO board and Integrated
Development Environment (IDE). Various constructs required for the development
of software are also covered. The working principle of various sensors is explained in
depth; programming and interfacing examples with Arduino are taken up and finally
some moderate-level projects.
Chapter 1 “Introduction to Arduino UNO Board” gives a detailed informa-
tion regarding various components mounted on Arduino UNO board, IDE, and
ATmega328 microcontroller.
Chapter 2 “Arduino Programming Constructs” gives an in-depth understanding
of various constructs required for the programming of Arduino. Readers will also
learn in this chapter about various operators, data types, and functions, which will be
helpful to them when they start developing software for some specific applications.
xi
xii Preface
Chapter 3 “I/O Devices, Actuators, and Sensors” deals with the construction and
working of various sensors, input devices, output devices, and actuators. The readers
will learn in this chapter the working principle and function of various pins of LED,
seven-segment display, liquid crystal display (LCD), temperature sensor (LM35),
humidity and temperature sensor (DHT11), light-dependent register, touch sensor,
smoke detector (MQ2), rain detector (FC-07), ultrasonic sensor (HC-SR04), soil
moisture sensor (YL-69), Bluetooth module (HC-05), GSM module (SIM 900A),
switch, keypad matrix, potentiometer, analog-to-digital converter IC, motor driver
board (L293D), and relay board.
Chapter 4 “Interfacing and Programming with Arduino” gives detailed information
about how to interface input and output devices, viz., switch, keypad matrix, LED,
seven-segment display, liquid crystal display (LCD) with Arduino UNO board, and
the process of developing application programs for the interfaced circuit.
Chapter 5 “Arduino-Based Projects” covers interfacing and programming
concepts with a large number of circuit diagrams of few projects based on Arduino.
All efforts have been made to keep this book free from errors. I sincerely feel
that this book proves to be useful and helpful to the students for understanding
the interfacing and programming of Arduino. Constructive criticism and sugges-
tions from faculty members and dear students will be highly appreciated and duly
acknowledged.
xiii
Another Random Scribd Document
with Unrelated Content
snake) to creep back under the guard.’ Kormak said: ‘Many things do
you the wizards use?’ Skeggi replied: ‘This, however, will help thee
fully.’ After this, Kormak rode home and told his mother what had
happened; and said that her will had much power over Skeggi;
showed her the sword, and tried to draw it: but it would not leave
the scabbard. Dolla said: ‘Too self-willed art thou, kinsman.’ Kormak
put his feet on the guard, and tore off the bag; Sköfnung howled at
this, but could not be drawn from the scabbard.
“The time for the holmgang approached, and Kormak left home with
fifteen men. In the same manner Bersi rode to the place with as
many men. Kormak came first, and said to Thorgils that he wanted
to sit there alone. Kormak sat down and unfastened the sword, and
did not take care that the sun did not shine on its guard; he had girt
himself with it outside his clothes, and tried to draw it; but did not
get it out until he stepped on the guard; the small snake came, but
it was not handled as he should have been, and the luck of the
sword was changed, and it went howling out of the scabbard”
(Kormak’s Saga, c. 9).
“At Froda there was a large hall and a locked bed adjoined it, as
then was customary. On each side of the hall was a small room; one
of them was filled with dried fish and the other with flour. Meal fires
were made every night in the hall as was the custom. People used to
sit long at the fires before they went to their meal. When the
gravediggers came home that night, and men were sitting at the
fires at Froda, they saw a half moon appearing on the wall of the
room. All those who were inside could see it. It moved backwards
against the course of the sun through the room. It did not vanish
while they sat at the fire. Thorod asked Thorir Wood-leg what this
foreboded. Thorir answered it was the Urdarmani (moon of Urd).
Deaths of men will follow upon this. This continued all the week; the
urdarmani entered every night” (Eyrbyggja, c. 52).[399]
Helgi sang:
It is not an illusion
Which thou thinkest thou seest,
Nor the doom of the world,
Though thou seest us,
Though we our horses
Prick with spurs,
But the Hildings have got
Leave to go home.
Helgi and his men rode their way, and the maidens went home to
their house. The next evening Sigrun let a bondmaid keep watch at
the mound; and at sunset, when Sigrun came to the mound, the
bondmaid sang:
Now would have come,
If to come he intended,
The son of Sigmund[407]
From Odin’s halls;
I say that the hope
Of the king’s coming lessens,
As on ashtree boughs[408]
Eagles sit,
And all men throng
To the meeting of dreams.[409]
Be not so mad
As to go alone,
Sister[410] of Skjöldungs,
To the houses of the ghosts.
Stronger, maiden, become at night
All dead fiends,[411]
Than in the light of day.
There were ghosts who were supposed to kill people; the best
means of protection against them was to burn the body and throw
the ashes into the sea, or to cut off the head and put it at or
between the feet, as the body had then to walk on its own head.
Another way of getting rid of them was to pursue them by law, and
sentence them at the door of the house they haunted.[412]
Án had slain an outlaw, Garan, in a wood.
“Án left him dead; he cut off his head, dragged him out (of his
house), and put his nose between his legs, that he should not
appear after his death” (An’s Bogsveigis Saga, c. 5).
The people were strong believers in omens, to which they paid great
attention, and which were supposed to be seen by persons when
awake or in their dreams. Some omens repeated themselves before
recurring events of the same kind.
If any one imagined that he saw blood on his food, or that his food
disappeared, he expected a speedy and violent death;[415] and it was
a common belief that blood dripping from weapons, or their
sounding loud when used, foreboded a fierce battle or conflict.[416]
Before the burning of Njal the following omen, which proved true,
appeared at his farm Bergthorshval:—
“Bergthóra (his wife) carried food to the table. Njal said: ‘Strange
does this look to me now; I think I look all over the room, and that
both the gable-walls are off, and the table and the food all covered
with blood.’ All except Skarphédin were startled at this. He asked
them not to grieve or look sorrowful so that people would talk of it”
(Njala, c. 127).
“It happened when Gunnar and Kolskegg rode towards Rangá that
blood fell on the halberd of Gunnar. Kolskegg asked why this was so.
Gunnar answered that when this happened in other countries it was
called blood-rain, and Olver bondi in Hising said that this usually
foreboded great tidings” (Njala, c. 72).
Among these omens must be reckoned the so-called Urdarmáni (the
moon of Urd), a peculiar kind of appearance of the moon which
foreboded the death of many people.[418] There were also natural
omens, good and bad. It was considered a good omen if a warrior
saw a raven follow him when going to fight—the interpretation
probably being that the raven followed a victor in order to eat the
corpses of the enemy; it was also a good omen to see or meet two
men conversing, or to hear a wolf howl. When a man who was slain
by any kind of weapon fell on his face it was thought to be an omen
that he would be revenged, and the vengeance would come down
upon the man who stood just in front of him when he fell;[419] but to
stumble when going to fight, or to hear the croaking of ravens, was
considered a bad omen.
The second song of Sigurd Fafnisbani relates how Sigurd was going
to make war on the sons of Hunding. As he sailed along the coast a
man stood on a rock and asked him who they were. They answered,
and when they asked who he was he said he was called Hnikar (one
of Odin’s names), but they might call him the man of the rock, Feng
or Fjölnir (Odin’s names). He went on board and the storm ceased.
Sigurd sang
Hnikar.
A third is that
If thou hearest a wolf
Howl under ash-branches.
Good luck wilt thou get
Against helmet-staffs[420]
If thou seest the wolves ahead.
It is a great danger
If thou stumblest
When thou rushest into fight;
When thou rushest into fight;
Faithless Disir
Stand on either side of thee
And long to see thee wounded.
Thorbjorn.
Hromund.
“Once Njal and Thórd (his servant) were outside the farm. A he-goat
was in the habit of going about the grass-plot on the farm, and no
one was allowed to drive it away. Thórd said, ‘This is strange.’ Njal
asked, ‘What dost thou see which seems strange?’ He answered, ‘It
seems to me that the he-goat lies here in the hollow place, and is
bloody all over.’ Njal replied there was no he-goat there, nor
anything else. ‘What is it, then?’ inquired Thórd. ‘Thou must be a
death-fated man, and hast seen thy Fylgja,’ said Njal, ‘and guard
thyself well.’ ‘That will not help,’ added Thórd, ‘if death is fated to
me’” (Njala, c. 41).
“It is said that King Gorm once invited to a Yule-feast his father-in-
law Harald, who promised to come in the winter, and the
messengers so reported.
“When the time for preparation came the Jarl chose such followers
to the feast as he wanted. Knut went with him, but it is not said how
many men he had. They arrived at the Limafjord, and as they were
about to cross it they saw there an oak which appeared somewhat
unusual. There were growing on it acorns, which were small and
quite green, but under it lay others both ripe and large. At this they
wondered much, and the Jarl thought it very strange that there
should be green acorns at that time of the year, for there lay near
the oak those which had grown during the summer. ‘We will go
back,’ said the Jarl, ‘and proceed no farther.’ He thereupon returned
home, where he remained with his hird the next season. The King
deemed it strange that the Jarl did not come, but thought something
important had prevented him. All was quiet during the summer, and
when winter came the King invited the Jarl to the Yule-feast, as in
the previous year. The Jarl promised to go, as before, and when the
time came departed with his followers, and journeyed until he came
to the Limafjord. He had now come on board, and intended to cross
the fjord. It is said that they had with them pregnant bitches. After
they had got on board the Jarl thought he heard the whelps in the
bellies of the bitches barking, while the mothers themselves were
silent. This the Jarl and all regarded as the greatest wonder, and
they therefore turned back, and stayed at home during that Yule. On
the third winter the King again invited the Jarl, who promised to
come; and when the time came he departed, and journeyed until he
arrived at the Limafjord, resolving to remain there overnight. Then a
sight presented itself which was thought very strange. They saw a
wave rise within, and another without, the fjord, and the two
advanced to meet each other. The waves were large and made a
great noise when they met and fell together; then it seemed as if
the sea became bloody. Then the Jarl said, ‘This is a fearful portent,
and we must turn back and not accept the invitation.’ This they did,
and the Jarl remained at home also that Yule....
“It was resolved that the King should send messengers to the Jarl to
ascertain why he had not come. The Queen advised that they should
first meet and talk to him, and thus see what the reason was. When
the messengers told the Jarl of their errand, he quickly got ready
and went to visit Gorm with a fine retinue. The King received his
father-in-law well, and quickly went to speak with him. The King
asked why he had not once come at his bidding, and thus shown
disrespect to the King and his invitation. The Jarl replied that he had
meant no disrespect, but had not once come to the feast, because
other things had prevented him. He then told the wonders which
they had seen, as mentioned before, and asked if he would like to
know what he thought each wonder meant. To this the King
assented. The Jarl then said: ‘I will first take that one where we saw
an oak with small green acorns, with the old and large ones
underneath. That I think must foretell a change of belief which will
come over these lands, which will flourish more, and the fine acorns
foretell that; but the present belief is betokened by the old acorns on
the ground, and they will rot and become mere dust; this belief will
also fall and be destroyed when the new one rises. The second
wonder was when we heard the whelps bark in the bitches. That I
think must foretell that young men will take the words from the
mouths of the older, and become so reckless that they will have no
less to say, though the older are oftener wiser in counsels. And I
think that those of whom this will be true have not yet come into the
world, for the whelps which barked while the mothers were silent
were yet unborn.
“‘The third, when we saw the waves, one from the outer part, and
the other from the inner part of the fjord, meet midways and fall
each on the other’s neck, and the water become bloody from the
disturbance therefrom forebodes, I think, that some enmity will arise
between great men within the country, whence will come fights and
much disturbance. It is very likely that some offshoot of this war will
take place at the Limafjord, because it is there we have seen these
wonders of which I have spoken.’
“King Gorm was satisfied with the words of the Jarl, and thought him
wise; he gave him peace, and his anger departed. It is said that
before they went into the speech-room the King had set men to slay
the Jarl, if haughtiness and disrespect were the only reasons for his
not coming to the feast when invited; but the King now thought he
had good cause for not coming. They went away from the speech-
room, and the Jarl remained with him for a while. They then
separated in peace, and the Jarl received good gifts. He left with his
followers, and had a good journey home.
“A short time after Klakkharald gave his foster-son and kinsman Knut
all his realm, and Knut took the rule of Holtsetaland and all the
realms of Harald Jarl.
“The Jarl made ready to leave, and began his journey southward to
Valland. He there embraced Christianity, and never returned to
Denmark” (Flateyjarbók, vol. i.).
CHAPTER XXXII.
SUPERSTITIONS.—DREAMS.
“One night when King Ivar slept in the lypting[437] (upper deck) on
his dragon-ship, it seemed to him that a great dragon flew out of the
sea. Its colour was golden, and it glowed in the air as if sparks were
flying from the hearth of a forge, and shone over all the lands
nearest it. Behind it flew all the birds that he knew of in the northern
lands. He saw a great cloud rising in the north-east, followed by
such a rain-storm that it seemed to him all the forests and the whole
land were floating in the water which had fallen: this was
accompanied by thunder and lightning. When the large dragon flew
towards the land, he met the rain-storm, and such a darkness arose
that he could see neither the dragon nor the birds, but only heard
the loud sound of the thunder and the tempest. This passed south
and west over the land, and all over his realm. Then it seemed to
him all his ships had been changed into whales, and swam out to
sea. At this he awoke and called his foster-father, Hörd, told him his
dream, and asked him to interpret it. Hörd said he was so old he
could not understand dreams. He stood on a rock near to one end of
the gangway, but the king lay in the lypting, and was unfastening
the lower border of the tent as they talked. The king was in a bad
humour, and bade Hörd go down on the ship and interpret his
dream. Hörd answered that he would not, and said, ‘I need not
interpret thy dream; thou must know thyself what it means. It is
likely it will not be long before others rule Sweden and Denmark.
Now a greediness foreboding death has come upon thee, as thou
wantest to conquer for thyself every realm, and dost not know that
on the contrary thou wilt die and thy foes take thy realm.’ The king
said, ‘Come here and tell thy evil prophecies.’ Hörd said, ‘I shall
stand here and tell them.’ The king said, ‘To whom of the Asar was
Halfdan the Valiant like?’ Hörd answered, ‘He was as Baldr was with
the Asar, over whom all the gods wept, and not like thee.’ The king
said, ‘That is good. Come here and tell it.’ Hörd answered, ‘I will
stand here and tell.’ The king replied: ‘To whom of the Asar was
Hrærek like?’ ‘To Hænir, who was the greatest coward of the Asar,
though he was less cowardly than thou art.’ The king asked, ‘To
whom of the Asar was Helgi the Sharp like?’ Hörd replied, ‘He was as
Hermód, who was very bold, and did harm to thee.’ The king said,
‘To whom of the Asar was Gudröd like?’ Hörd: ‘He was as Heimdal,
who was the most foolish of all the Asar, and nevertheless a lesser
fool than thou.’ The king: ‘To whom of the Asar am I like?’ ‘Thou
resemblest the worst of all serpents existing, the Midgardsorm.’ The
king answered in great anger: ‘If thou tellest me I am death-
doomed, I can tell thee thou shalt live no longer, for I know thee,
thou great Thurs. Now come nearer, thou Midgardsorm, and let us
try our strength.’ The king rushed from the lypting, and was so
angry that he jumped out under the lower edge of the tent. Hörd
plunged into the sea from the rock, and the men on the watch on
board the king’s ship saw neither of them come up on the surface
afterwards” (Sögubrot, c. 3).
“He (Gjúki) had three sons, Gunnar, Högni, and Guttorm. Gudrún,
his daughter, was a most famous maiden.... Gjúki was married to
Grímhild, the witchcraft-knowing. King Budli was more powerful than
Gjúki, though both were powerful. Atli, the brother of Brynhild
(Budli’s daughter), was a cruel, large, swarthy man, but of an
imposing look, and the greatest warrior. Grímhild was a woman of
fierce mind. The Gjúkungs flourished much, mostly because of their
children who surpassed most others. Once Gudrún told her maidens
that she could not be merry. A woman asked her what was the
reason. She answered: ‘We did not get good luck in dreams, and the
sadness of my heart thou didst ask about is caused by a dream.’ The
woman said: ‘Tell me, and let it not sadden thee, for dreams often
forbode the weather.’ Gudrún said: ‘This one does not. I dreamt that
I saw a fine hawk on my hand; its feathers had a golden colour.’ The
woman said: ‘Many have heard of your beauty, wisdom, and
courtesy; the son of some king will ask thee in marriage.’ Gudrún
said: ‘Nothing did I think better than the hawk, and I would rather
have lost all my property than lose it.’ The woman said: ‘Thy
husband will be a great man, and thou wilt love him much.’ Gudrún
said: ‘It grieves me that I do not know who he is; let us go to
Brynhild, she will know it.’ They made ready with gold and great
beauty, and went with their maidens till they came to Brynhild’s hall,
which was adorned with gold, and stood on a mountain. When they
were seen, Brynhild was told that many women in gilded
waggons[438] drove towards the burgh. She replied: ‘That must be
Gudrún, Gjúki’s daughter; I dreamt of her this night; let us go out
and meet her; handsomer women (than she) cannot visit us.’ ...
Gudrún said: ‘I dreamt that many of us walked together from the
skemma and saw a large hart which far surpassed other deer; its
hair was of gold. We all wished to catch it, but I alone succeeded,
and I loved it above all other things. Then thou didst shoot it at my
knees, which was such a sorrow to me that I could scarcely bear it.
Then thou gavest a wolf’s cub to me, which besprinkled me with the
blood of my brothers.’ Brynhild answered: ‘I will explain what will
happen. Sigurd, whom I chose for my husband, will come to you;
Grímhild will give him a mixed mead which will cause heavy trials for
all of us; thou wilt marry him and quickly lose him; thou wilt marry
King Atli; thou wilt lose thy brothers and slay Atli.’ Gudrún said: ‘A
sore sorrow is it to us to know such things.’ They went away home
to King Gjúki” (Volsunga, c. 25).
The following dream foreboded the death of Gisli, who fell after one
of the most memorable defences recorded:—
“Gisli laid himself down and tried to sleep, while they (Aud and
Gudrid) were awake; and a sleep came over him. He dreamt that
two birds came to the house and fought by stealth; they were rather
larger than cock ptarmigans, and screamed rather loudly; they were
dyed all over in blood. He awoke after this. And (his wife) asked if
he had dreamt anything: ‘Thy sleep-journeys are not good now,’ said
she. He sang a song (describing what he had dreamt)” (Gisli
Sursson’s Saga, p. 95).
When the brothers Gunnar and Hogni were invited on a visit by King
Atli, by whom they were afterwards slain, their wives dreamt bad
dreams. Kostbera, Hogni’s wife, tells her dream to her husband, and
Glaumvör afterwards to hers, in order to dissuade them from going.
Kostbera.
Hogni.
Kostbera.
Hogni.
Kostbera.
Hogni.
Glaumvör.
Glaumvör.
Gunnar.
Glaumvör.
(Atlamál.)
“It happened that the son of a high-born woman lost his memory, as
if he was insane. His mother came to King Harald, and asked him for
good advice. The king advised her to go and see King Magnus, for
he knew there was none better in the land, and he would give
counsel. She went to King Magnus accordingly, who said, ‘Did you
not see King Harald?’ ‘I did,’ answered she, and told him what he
said. King Magnus added, ‘Nobody is wiser than King Harald in this
land, and he can give some advice if he have the will.’ King Harald,
on hearing this, said: ‘Then I shall give some. I think I see what ails
thy son: he is draumstoli,[444] for it is not the nature of a man that he
dream not. I advise thee to go to where King Magnus has washed
his hands, and let the boy drink from the water. Then you shall make
him sing. Though he is struck by sleepiness and yawning, you shall
not let him sleep, but take him to where the king has rested himself,
and let him fall asleep there, and then it is most likely that a dream
will appear to him.’ She did all as she had been told, and her son
slept there a while; and when he awoke he smiled and said, ‘I
dreamed, mother. It seemed as if the Kings Magnus and Harald
came to me, and each spoke in one of my ears.’ ‘Rememberest thou,
my son,’ asked she, ‘what each one of them said?’ ‘I do,’ he said.
‘King Magnus said, “Be as good as you can.” Not long after, King
Harald said, “Be most quick at learning, and retain in your memory
what you learn as best you can.”’ This boy afterwards became a
remarkable man.”
“The king (Helgi) had drunk so heavily that he at once fell asleep on
the bed, and the queen seized her opportunity and stung him with a
sleep-thorn; when all was quiet she rose, shaved off all his hair and
besmeared him with tar, then she took a leather bag and put some
cloth in it in which she wrapped him up, and bade some men take
him down to his ships. She roused his men, saying that their king
had gone on board and wished to sail, as there was a fair wind.
They all jumped up as quickly as they could, but as they were drunk
did not know what they were doing; they went to the ships, and saw
no king but a very large leather bag. They wanted to see what was
in it and wait for the king, as they thought he would come later on.
When they untied it they found the king inside. The sleep-thorn
dropped down and he awoke from a bad dream, and was enraged
with the queen” (Hrólf Kraki’s Saga, c. 7).[445]
CHAPTER XXXIII.
THE STRUGGLE BETWEEN PAGANISM AND
CHRISTIANITY.
“Wise men say that some of those who settled in Iceland had been
baptized, and that most of those who came from the West (British
Islands) had been baptized. Among them are named Helgi the Lean,
Örlyg the Old, Helgi Bjóla, Jörund the Christian, Aud the Deep-
minded, Ketil, and others who came from the West; and some of
them kept Christianity well till their death-day; but their families
seldom preserved it, for some of their sons raised temples and
sacrificed, and all the land was heathen for nearly one hundred
winters” (Landnáma, v., c. 15).
But the struggle continued for some time, for the people were loth
to abandon the ancient faith, and Hakon was obliged, as king, to
assist at the sacrificial feast at the temple at Hladir. Sigurd jarl on
one occasion dedicated the first toast to Odin, and the king drank