How to upgrade or downgrade raspberrypi’s kernel? (Servoblaster problem Raspberry Pi2)


How to upgrade or downgrade raspberrypi’s kernel?

Lately, I got some problems with servoblaster and some other softwares because of the kernel version. That is why sometimes it is good idea to have previous kernels rather than very last one. To solve these kind of problems we can downgrade linux kernel.

For those who had problem with servoblaster on raspberrypi2, servoblaster DID work on kernel 4.0.9 ! !!

 

Here how we downgrade(upgrade) our kernel to a specific kernel with rpi-update.

First, install rpi-update

sudo apt-get install rpi-update

 

Then, go to the firmware repository of rpi: https://github.com/Hexxeh/rpi-firmware/commits/master

Find your kernel version. I will install 4.09 so here how I do:

2015-09-29 15_46_00-Photos

Then get the git hash as shown in the following image:

2015-09-29 15_53_08-Photos

After copying the git hash, type this in the terminal:

sudo rpi-update  46d179597370c5145c7452796acbee0f1ff93392->This is kernel 4.0.9’s git hash you should use the one that you copied.

You should get something like in the following image:

2015-09-29 15_42_32-pi@raspberrypi_ ~

Then reboot your system.

 

 

 

Writing/Reading Integer 2D Arrays to/from Arduino’s Internal EEPROM – Arduinonun Harici EEPROM una Tamsayi Matris Yazip Okuma


2015-01-26 13_32_48-COM8

To download EEPROMex Library, please visit http://thijs.elenbaas.net/2012/07/extended-eeprom-library-for-arduino/

CODE:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <EEPROMex.h>
#include <EEPROMVar.h>

int address = 0;
int mode[16][6];
int i=0, j=0;
int modeEEPROM[16][6];

void setup()
{
Serial.begin(9600);
Serial.println("The 2D Array has been generated in order to write into EEPROM :");
 //Set the mode matrix all 0's
 for(i=0;i<16;i++){
   for(j=0;j<6;j++){
     mode[i][j]=i+j;
   }}

for(i=0;i<16;i++){
  Serial.println();
   for(j=0;j<6;j++){
    Serial.print(mode[i][j]);
    Serial.print("\t");
   }}
 
   for(i=0;i<16;i++){
   for(j=0;j<6;j++){
EEPROM.writeInt(address, mode[i][j]);
address+=2;
   }}
   address=0;
   for(i=0;i<16;i++){
   for(j=0;j<6;j++){
modeEEPROM[i][j]=EEPROM.readInt(address);
address+=2;
   }}
  Serial.println();
  Serial.println("The 2D Array has been read from EEPROM :"); 
  for(i=0;i<16;i++){
    Serial.println();
   for(j=0;j<6;j++){
    Serial.print(modeEEPROM[i][j]);
    Serial.print("\t");
   }} 


}

void loop(){}

Arduino Uno Smart Line Following Robot With Obstacle Detection


Here is all the documentation. Make your own robot!

CadSoft Eagle Schematic:isaeagleshcematic

CODE:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#include <Servo.h>

Servo left;
Servo right;
const int leftSensor=A4; //LeftLineSensor
const int rightSensor=A5; //RightLineSensor
const int leftLED=10;
const int rightLED=4;
const int Sensivity=475; // Sensivity is a number which you take as a reference to identify the color change. Normally, qrd1114(line sensor) sends analog signal which varies 0-100 for white color. This output of qrd1114 increases up to 650. This means there is a color change or the sensor is on the black surface.
int i=0;
int FL=1700; // Left Servo Forward
int FR=1300; //Right Servo Forward
int R=0;
int L=0;

void setup()
{
left.attach(12); //left servo motor
right.attach(13); //right servo motor
pinMode(leftSensor, INPUT);
pinMode(rightSensor, INPUT);
pinMode(3, INPUT); pinMode(2, OUTPUT); // Left IR LED & Receiver
pinMode(7, INPUT); pinMode(6, OUTPUT); // Right IR LED & Receiver
pinMode(leftLED, OUTPUT); pinMode(rightLED, OUTPUT); // Left&Right LED
Serial.begin(9600); // Set data rate to 9600 bps

tone(11, 3000, 1000); // Play tone for 1 second
delay(1000); // Delay to finish tone
}

void loop()
{
int leftSens = ReadSens_L();
int rightSens = ReadSens_R();

int irLeft = irDetect(2, 3, 38000); // Check for object on left
int irRight = irDetect(6, 7, 38000); // Check for object on right
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
if((irLeft=irDetect(2, 3, 38000))==0) // Obstacle Avoidance and Navigation Section
{

while((irLeft=irDetect(2, 3, 38000))==0)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
Serial.println(" Obstacle Detected on the Path! Turning Left");
delay(1);

Serial.print(irLeft); // Display 1/0 no detect/detect
Serial.print(" "); // Display 1/0 no detect/detect
Serial.println(irRight); // Display 1/0 no detect/detect

tone(11, 300, 100); // Play tone for 1 second
delay(300); // Delay to finish tone

digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}

if((irRight = irDetect(6, 7, 38000))==1)
{

while((irRight = irDetect(6, 7, 38000))==1)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
Serial.println("Continue Turning Left");
Serial.print(irLeft); // Display 1/0 no detect/detect
Serial.print(" "); // Display 1/0 no detect/detect
Serial.println(irRight); // Display 1/0 no detect/detect
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}
while((irRight = irDetect(6, 7, 38000))==0)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
Serial.println("Turn Left!");
Serial.print(irLeft); // Display 1/0 no detect/detect
Serial.print(" "); // Display 1/0 no detect/detect
Serial.println(irRight); // Display 1/0 no detect/detect
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}
}
else
{
while((irRight = irDetect(6, 7, 38000))==0)
{
left.writeMicroseconds(FL);
right.writeMicroseconds(FR);
Serial.println("Forward!");
Serial.print(irLeft); // Display 1/0 no detect/detect
Serial.print(" "); // Display 1/0 no detect/detect
Serial.println(irRight); // Display 1/0 no detect/detect
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}
}

while( (leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())<Sensivity )
{
while((irRight = irDetect(6, 7, 38000))==0 && (leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())<Sensivity)
{
left.writeMicroseconds(1600);
right.writeMicroseconds(1400);
digitalWrite(rightLED, !irRight);
}
while((irRight = irDetect(6, 7, 38000))==1 && (leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())<Sensivity)
{
left.writeMicroseconds(1550);
right.writeMicroseconds(1550);
digitalWrite(rightLED, !irRight);
delay(1);
}
}
left.writeMicroseconds(1500);
right.writeMicroseconds(1500);

if((leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())>Sensivity) // Entering Line
{
while((leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())<Sensivity)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}}
else
{
if((leftSens = ReadSens_L())>Sensivity && (rightSens = ReadSens_R())<Sensivity)
{
while((rightSens = ReadSens_R())<Sensivity)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
digitalWrite(leftLED, !irLeft);
delay(1);
digitalWrite(rightLED, !irRight);
delay(1);
}
while((rightSens = ReadSens_R())>Sensivity)
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
delay(2);
}
}}}
else //Line Following Section
{
//----------------------------------------------------------------
// This is Line Sensor Test
/* Serial.print(leftSens);
delay(1);
Serial.print(" <--L R--> ");
delay(1);
Serial.println(rightSens);
delay(1000);
*/
//----------------------------------------------------------------

while( (leftSens = ReadSens_L())>Sensivity && (rightSens = ReadSens_R())>Sensivity )
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
delay(2);
}

Serial.println(" Following Line");
delay(1);
Serial.print(irLeft); // Display 1/0 no detect/detect
Serial.print(" "); // Display 1/0 no detect/detect
Serial.println(irRight); // Display 1/0 no detect/detect
if( (leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())<Sensivity )
{
left.writeMicroseconds(FL);
right.writeMicroseconds(FR);
delay(2);
}
else
{
if( (leftSens = ReadSens_L())>Sensivity && (rightSens = ReadSens_R())<Sensivity )
{
left.writeMicroseconds(FR);
right.writeMicroseconds(FR);
delay(2);
}
else
{
if( (leftSens = ReadSens_L())<Sensivity && (rightSens = ReadSens_R())>Sensivity )
{
left.writeMicroseconds(1700);
right.writeMicroseconds(1700);
delay(2);
}
}}}

}
int ReadSens_L(){
int i;
int L = 0;
for (i = 0; i < 5; i++){
L = L + analogRead(A4); // sensor on analog pin A2
}

L = L / 5; // average
return L;
}
int ReadSens_R(){
int j;
int R = 0;

for (j = 0; j < 5; j++){
R = R + analogRead(A5); // sensor on analog pin A3
}
R = R / 5; // avarage
return R;
}
// IR Object Detection Function

int irDetect(int irLedPin, int irReceiverPin, long frequency)
{
tone(irLedPin, frequency, 8); // IRLED 38 kHz for at least 1 ms
delay(1); // Wait 1 ms
int ir = digitalRead(irReceiverPin); // IR receiver -> ir variable
delay(1); // Down time before recheck
return ir; // Return 1 no detect, 0 detect
}

Isa Hatipoglu © WordPress Post

Arduino Uno Line Following Robot – Arduino Uno Cizgi Izleyen Robot


Hardware:
Robot Shield
Arduino Uno R3
Black Tape
QRD1113 IR Sensors (x2)
Resistors(2x10k, 2×220)

Code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include

Servo left;
Servo right;
const int leftSensor=A2;
const int rightSensor=A3;
int i=0;
int FL=1700; // Left Servo Forward
int FR=1300; //Right Servo Forward
int R=0;
int L=0;
void setup()
{
Serial.begin(9600);
left.attach(12); //left servo motor
right.attach(13); //right servo motor
pinMode(leftSensor, INPUT);
pinMode(rightSensor, INPUT);

}
void loop()
{
int leftSens;
int rightSens;
leftSens = ReadSens_L();
rightSens = ReadSens_R();
Serial.println("Beginning");
Serial.println(leftSens);
Serial.println(rightSens);
if(leftSens<400&&rightSens<400) { left.writeMicroseconds(FL); right.writeMicroseconds(FR); Serial.println("Forward!"); delay(40); } else { if(leftSens>400&&rightSens<400)
{
left.writeMicroseconds(1450);
right.writeMicroseconds(1400);
Serial.println("Turn Left!");
delay(10);
Serial.println(leftSens);
delay(10);
Serial.println(rightSens);
delay(10);
int leftSens = ReadSens_L();
delay(10);
int rightSens = ReadSens_R();
delay(10);
}
else
{
if(leftSens<400&&rightSens>400)
{
left.writeMicroseconds(1600);
right.writeMicroseconds(1550);
Serial.println("Turn Right!");
delay(10);
Serial.println(leftSens);
delay(10);
Serial.println(rightSens);
delay(10);
int leftSens = ReadSens_L();
delay(10);
int rightSens = ReadSens_R();
delay(10);
}
else{

}}}
}
int ReadSens_L(){
int i;
int L = 0;
for (i = 0; i < 5; i++){
L = L + analogRead(A2); // sensor on analog pin A2
}

L = L / 5; // average
return L;
}
int ReadSens_R(){
int j;
int R = 0;

for (j = 0; j < 5; j++){
R = R + analogRead(A3); // sensor on analog pin A3
}
R = R / 5; // avarage
return R;
}

Value-Based Software Engineering


(This writing is a summary of Barry Boehm’s “Value-Based Software Engineering” article.)

The paper written by Barry Boehm discusses “Value-Based Software Engineering” which is basically about “value”. The dictionary meaning of value is that the regard that something is held to deserve; the importance, worth, or usefulness of something. According to Boehm, in order to have a more realistic software design, division of value should be separated correctly. To give an example, earlier software designs were value-neutral, so they are used to fail due to lack of user input, incomplete requirements, changing requirements, lack of resources, unrealistic expectations, unclear objectives, and unrealistic time frames. Failures occur because the process of design is done without considering essential factors adequately.
He introduces seven key elements which form value based software engineering framework. According to this framework, the first part is shared vision, gathering all information, ideas, concerns, expectations and so on in order to have a realistic prediction for the future of the software, the part which includes first three elements. First one is “Benefits Realization Analysis” in which “Result Chain” which is to determine the initiatives and the stakeholders’ desired outcomes, and the other factors connecting these first two in order to complete the system is used. In this part, the factors are not only the software related but also related to other ingredient such as economic, time, human, and so forth. Second, “Stakeholder Value Proposition Elicitation and Reconciliation” meaning that eliminating arguments by using “Model-Clash Spiderweb” in order to reconcile. In other words, this step is the decision making with various values of different people. Third, “Business Case Analysis” which aims at creating a realistic financial plan considering return on investment across a system’s lifecycle.
The second section of the framework is “Planning and Execution” where the fourth and fifth elements are placed. The fourth element is “Continuous Risk and Opportunity Management” in which risk analysis and risk management are performed, so that eliminating uncertainties by prototypes, surveys, focal point person who watches marketplace or technology. Risk analysis and management is important because there might be rapid changes which might affect the performance of the design. The fifth element is “Concurrent System and Software Engineering” that stands for performing simultaneously product’s or service’s operational concept, requirements, architecture, lifecycle plans, and key sections of code because the changes affect these processes simultaneously. Therefore to be able to respond rapidly to changes, fifth element occurs to fix this emerging issue.
Third part of the framework is monitoring which is the sixth element: “Value Based Monitoring and Control”. Monitoring is the process of checking whether assumptions, outcomes, contributions, cost predictions are the same as the original plan. If not, a corrective action is required.
The last element, “Change as Opportunity”, is proposed by the author in order to identify and reorient the project to address unexpected risks and opportunities. According to Boehm, design should be adaptable to changes because change is the inherent character of the real world.
To sum up, Boehm introduces the value-based software engineering and shows that it has countless advantages compared to value neutral approaches because, as he says, “Better decision making is the key enabler of greater value added.” In order to make better decisions, we need to integrate the value consideration into our design process.

Isa Hatipoglu – 09/24/2014

(This writing is a summary of Barry Boehm’s “Value-Based Software Engineering” article.)

Açıktaki Gemi


Image

“Önce mahallede akan yağmur suyuna bırakılan kağıttan gemiler gibiydik. Sular birikti, aktı aktı derelere ulaştı. Sonra dereler gün yüzüne çıktığı yüksek yaylalardan, dağlardan kaçarak denizlere… Uzun bir süre dalgalar dövdü bizi. Uzaklara gitmek için her deneyişte o büyük heybetli dalgalar engel oldu. Ama o açıkta demirlemiş gemi hep bizi çağırdı sanki, bizi bekliyor gibiydi. Kıyıdan bakıldığında görünen heybetiyle, koskoca denize aldırmayan cesaretiyle adeta büyülüyordu bizleri. Sonra bir gün dalgaların o kadar da büyük olmadığını fark ettik. Bir cesaretle, boğulmayı göze alarak yüzmeye başladık açıktaki gemiye doğru. Karadan uzaklaştıkça açıklayamadığımız duygularla boğuşmaktan denizi, gemiyi unuttuk gitti. Atılan her kulaç o kaçmaya çalıştığımız sahili daha da güzelleştirdi. Aslında açıktaki o heybetli gemide yaklaştıkça güzelliğini yitiriyordu. Her yorgunluk hissinde arkaya bakıp o muhteşemliği görüp buna rağmen uzaklaşmaya devam etmek en büyük çelişki oldu içinden çıkamadığımız… “

 

İsa HATİPOĞLU

Can Sıkıntıları

The Leader


Image

People dream, but very few of them make dreams come true. Mustafa Kemal Ataturk was such person who was one of those heroes. He was born in 1881 in Salonica, which is in Greece now. His mother was a housewife, and his father was a military officer in Ottoman Army, as Ataturk would be. He grew up in a very harsh time during which Ottoman was stuck politically and economically. He shined in World War I, and these tough times challenged him, therefore he became the leader of Turkish National Movement as an excellent soldier. He was not only a great soldier but also the first President of Republic of Turkey and a revolutionary statesman.

The first reason why I admire him is that he was an intelligent soldier. Although his parents wanted him to study trade, he took the military entrance exam. As a result, he study at Salonica Military School. After graduating from Salonica Military School, he continued his education at Monastir Military High School. After he had graduated from Ottoman Military Academy, he was assigned to the fifth Army of Ottoman. To give an example, in the army, he accomplished massive goals. He started to shine because of his intelligence. Similarly, in the World War I, he succeeded to be a great commander, and made Ottoman stand against its enemies especially in Battle of Gallipoli, which was a turning point for Ataturk. On 19th of May 1919, he set a huge movement off in order to be independent, and he was successful. After that, he founded Republic Of Turkey by making people believe in an idea which claims that Turkish War of Independence would be successful. He was an excellent soldier that he guided his people to freedom.

The second reason why I admire him is that he was the first President of Turkey. The most important thing that I was influenced was Ataturk’s determination to found the Turkish Republic. To illustrate, during World War I, he arranged several meetings which let him to explain his aim which was to establish a new government instead of continuing with stucked Ottoman. First, under his leadership, the legitimate government was established on 23 April 1920. On 29 October 1923 the Republic Of Turkey was officially proclaimed. Ataturk was chosen the first President of Turkey. He was the only one person that deserved this hundred percent. If he had not founded Republic Of Turkey, my nation would not have had freedom. This is one of the most important reasons that he is my role model and I admire him.

Thirdly, I admire him because he was a revolutionary statesman. For instance, after he had been chosen as the first President, he made a lot of things which were transformed from the old style of ideas into modern ideas by him. For example, he published a lot of book to explain himself. His reforms taught the people of Turkey to be free and democratic. He is still being criticized by the citizens of Turkey in some ways especially a secular government system which provide the people who live in Turkey equality in terms of religious differences. Some examples of his reforms are new alphabet, to cease the caliphate, some educational reforms, and so on.

To sum up, at the same time, he was an intelligent soldier, the first President of Turkey and a revolutionary statesman. He affected a lot because of his determination even in the worse times. He taught me not to give up and to be aware of my potential. In spite of the fact that some people adversely criticize him, he was a great person and a real hero for me and I will always follow his way as long as I live.

Isa HATIPOGLU

08 October 2013 – Essay

Work And Travel Hakkında Tavsiyeler


Merhaba arkadaşlar,

Öncelikle work and travel geçmişim 4 5 yıl olmasa da bazı sorunlarla karşılaştığımız için bu yazıyı yazmayı ve programa katılmayı düşünen arkadaşlara özellikle gitmeden önce dikkat etmeleri gereken hususlar hakkında bilgi vermek istedim.

Öncelikle ilk dönem sonunda pasaportunuzu çıkartmanızda fayda var. Neden diyeceksiniz şubat 15 ten önce  şirkete tüm evraklarınızı vermiş olmalısınız ki herhangi bir aksilik çıktığında (isim soruşturması ds formlarının gelmesi vize almada herhangi bir sorun gibi…) zamanınız olsun.

Ardından en önemlisi aracı şirket seçimi… Bu konu hayati önem taşıyor. Neden sorusunun cevabı da Türkiye’de bu işi iyi yapan bir şirket var… Benim tavsiyem United Towers tabi tercih sizin. Gerek ds formları gerek işler açısından en güvenilir şirket… Bu yazıyı United Towersla hiçbir alakam olmadan yazdığıma sizi temin ederim. Geçen yıl United Towers ile gitmiştim ve bu yıl farklı bir şirketle gidiyorum ve aradaki uçurumları gördüm benim yaptığım hatayı sizin de yapmanızı istemem…

Ardından gerekli evraklarınızı şirkete verdikten sonra ds formunu bekleyeceksiniz bu arada uçak biletinizi de almanızda fayda var.

Ds formunuz sevis belgeleriniz ve diğer evraklarınız hazır olduğunda en geç mart ayında vizeye gitmenizde fayda var çünkü isim taraması 2 ay bile sürebilir… Bu yüzden en geç martta gitmenizi tavsiye ederim.

Ardından vizenizi aldığınızda gerisi kolay… İyi bir yaz geçirmeniz dileğiyle.