forked from Farhad1234/Vegetable-Picker-Bot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspiarduino.ino
43 lines (36 loc) · 826 Bytes
/
spiarduino.ino
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
//unsigned char hello[] = {'H','e','l','l','o',' ',
/// 'R','a','s','p','i','\n'};
char marker,tem;
//int ss=10;
void setup() {
// pinMode(MISO,OUTPUT);
//pinMode(ss,INPUT);
SPCR |= _BV(SPE);
Serial.begin(9600);
// put your setup code here, to run once:
}
void loop (void)
{
//digitalWrite(ss,LOW);
if((SPSR & (1 << SPIF)) != 0)
{tem=/*(char)*/SPDR;
// if(tem=='w' || tem=='d' || tem=='s' || tem=='a')
marker = tem;
}Serial.print(marker);
}
/*void loop() {
if((SPSR & (1 << SPIF)) != 0)
{
// SPDR = hello[marker];
// marker++;
marker = SPDR;
//marker= (char)marker;
//if(marker > sizeof(hello))
//{
// marker = 0;
//}
//while(marke
Serial.println((char)marker);
}
// put your main code here, to run repeatedly:
}*/