עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

מה לא בסדר בתוכנית שכתבתי

Featured Replies

פורסם

שלום לכולם,

אני חדש בתחום ודי מתלמד

רציתי לדעת בתיכנות שלי איפה טעיתי אםן מישהו יכול למצוא את הטעות שלי:

#define Time 500
int Led_1 = 2;
int Led_2 = 3;
int Led_3 = 4;
int Led_4 = 5;
int Led_5 = 6;
int Led_6 = 7;
int Led_7 = 8;

void setup()
{
pinMode (Led_1, OUTPUT);
pinMode (Led_2, OUTPUT);
pinMode (Led_3, OUTPUT);
pinMode (Led_4, OUTPUT);
pinMode (Led_5, OUTPUT);
pinMode (Led_6, OUTPUT);
pinMode (Led_7, OUTPUT);
pinMode (Led_8, OUTPUT);
}

void loop()
{
digitalWrite(Led_1, 0);
digitalWrite(Led_2, 0);
digitalWrite(Led_3, LOW);
digitalWrite(Led_4, 0);
digitalWrite(Led_5, 0);
digitalWrite(Led_6, 0);
digitalWrite(Led_7, 0);
digitalWrite(Led_8, LOW);
delay (Time);
digitalWrite(Led_1, HIGH);
delay (Time);
digitalWrite(Led_2, 1);
delay (Time);
digitalWrite(Led_3, 1);
delay (Time);
digitalWrite(Led_4, 1);
delay (Time);
digitalWrite(Led_5, 1);
delay (Time);
digitalWrite(Led_6, 1);
delay (Time);
digitalWrite(Led_7, HIGH);
delay (Time);
digitalWrite(Led_8, 1);
delay (Time);
}

נערך על-ידי AKEL

פורסם

לפני שאנשים יתחילו לנבור בקוד התכנית שלך כדאי שתפרט מה ניסית לעשות.

האם קיבלת שגיאה מסוימת? תוצאה לא נכונה?

פורסם
  • מחבר

התוכניות אמורה להיות שהיא מדליקה בסדר משמאל לימין שמונה נורות לד. כאשר בין הדלקה להדלקה יש להמתין חצי שניה. לאחר המתנה כשכל הנורות דולקות יש לכבות את כל הנורות ולחזור על סדר הדלקן אין סוף פעמים.

זה חלק ראשון של התרגיל שאמור להדליק אותם בעצם בסדר עולה בהפרש של חצי שניה

כן קיבלתי שגיא בשורה של: digitalWrite(Led_8, LOW);

שאומרת כך:

Arduino: 1.6.5 (Windows 7), Board: "Arduino Uno"

_8_Leds_-_1.ino: In function 'void setup()':

_8_Leds_-_1:19: error: 'Led_8' was not declared in this scope

_8_Leds_-_1.ino: In function 'void loop()':

_8_Leds_-_1:31: error: 'Led_8' was not declared in this scope

'Led_8' was not declared in this scope

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

פורסם

חסרה לך ההגדרה של המשתנה Led_8

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.