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

מבנה הנקבומט:
גוף הנקבומט הורכב מבובת ראווה פשוטה אשר הולבשה על כן מרהיב אותו בנה תומר, ההנדי מן שלנו, כפרה עליו. בראש הנקבומט מסך מחשב, המחובר למחשב.
הממשק הפיזי המפעיל את הנקבומט פשוט למדי: הוא מפעיל את המערכת של הנקבומט על ידי שלושה קלטים: אחד מהם מתג רגעי (באיזור הוגינה) ושני פוטנציומטרים, נגדים משתנים, באיזור הפטמות. סיבוב הפטמות מזיז את סמן העכבר על מסך הנקבומט. פטמה ימין שולטת על ציר Y, ואילו פטמה שמאל שולטת על ציר X. לחיצה על כפתור הוגינה משמשת כלחיצת עכבר.

הקוד המפעיל את המנגון
int potentiometerPin1 = 1; // input pin for the potentiometer. Must be analog
int potentiometerPin2 = 2; // input pin for the potentiometer. Must be analog
int Switchpin = 2; // input pin for the digital switch.
int x_val = 0; // variable to store the x value coming from the potentiometer
int y_val = 0; // variable to store the x value coming from the potentiometer
bool switch_on = 0; // switch digital input
void setup()
{
pinMode(potentiometerPin1, INPUT); // declare the potentiometer pin as an INPUT
pinMode(potentiometerPin2, INPUT); // declare the potentiometer pin as an INPUT
pinMode(Switchpin, INPUT); // declare the switch digital pin as an INPUT
Serial.begin(9600); // sopens serial port, sets data rate to 9600 bits per second
}
void loop()
{
x_val = analogRead(potentiometerPin1); // read the value from the potentiometer
y_val = analogRead(potentiometerPin2); // read the value from the potentiometer
switch_on = digitalRead(Switchpin); // read the value from the switch
Serial.print("x=");
Serial.println(x_val, DEC);
delay(50); // waits for a second
Serial.print("y=");
Serial.println(y_val, DEC);
delay(50); // waits for a second
if (switch_on==1){
//what to do when the user press on pussy
Serial.println("s=1"); //send the PC an indication that the switch was pressed
}
else {
Serial.println("s=0");
}
delay(50); // waits for a second
int potentiometerPin2 = 2; // input pin for the potentiometer. Must be analog
int Switchpin = 2; // input pin for the digital switch.
int x_val = 0; // variable to store the x value coming from the potentiometer
int y_val = 0; // variable to store the x value coming from the potentiometer
bool switch_on = 0; // switch digital input
void setup()
{
pinMode(potentiometerPin1, INPUT); // declare the potentiometer pin as an INPUT
pinMode(potentiometerPin2, INPUT); // declare the potentiometer pin as an INPUT
pinMode(Switchpin, INPUT); // declare the switch digital pin as an INPUT
Serial.begin(9600); // sopens serial port, sets data rate to 9600 bits per second
}
void loop()
{
x_val = analogRead(potentiometerPin1); // read the value from the potentiometer
y_val = analogRead(potentiometerPin2); // read the value from the potentiometer
switch_on = digitalRead(Switchpin); // read the value from the switch
Serial.print("x=");
Serial.println(x_val, DEC);
delay(50); // waits for a second
Serial.print("y=");
Serial.println(y_val, DEC);
delay(50); // waits for a second
if (switch_on==1){
//what to do when the user press on pussy
Serial.println("s=1"); //send the PC an indication that the switch was pressed
}
else {
Serial.println("s=0");
}
delay(50); // waits for a second
אין תגובות:
הוסף רשומת תגובה