Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): lor: #fff; color: #000; }
| G in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): tr> | G | G | GGo in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): rif size=10>GoGoGoGoo in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): 5f4>GooGooGoooog in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): 335>oogoogoogogl in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : AttValue: " or ' expected in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): c05>oglogloglgle in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Opening and ending tag mismatch: html line 1 and font in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): =#4285f4>gle in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Extra content at the end of the document in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): =#4285f4>gle in /app/components/com_wawerko/controllers/show.php on line 937
Warning: SimpleXMLElement::__construct(): ^ in /app/components/com_wawerko/controllers/show.php on line 937
Schritt 3 / 4 - Treiber
Ich habe ein Visual Basic-Programm programmiert und auf dem PC als Treiber für die Maus installiert, weil ich ehrlich gesagt zu faul war, um den Mod zu einem Standard-COM-Port kompatibel zu machen. Das wäre aber sicherlich möglich, denke ich.
[SOURCE CODE]
program Mouse
Dim aX as integer
Dim aY as integer
Dim sX as integer
Dim sY as integer
Dim But as byte
main:
TRISB = 0
PORTB = 0
TRISC = 255
Usart_Init(9600)
ANSEL = %00000111
lop:
aX = Adc_Read(0)
aY = Adc_Read(1)
sX = aX >> 2
sY = aY >> 2
But = %11111000
If TestBit(PORTC, 0) = 1 then
But = But OR %00000001
end if
If TestBit(PORTC, 1) = 1 then
But = But OR %00000010
end if
If TestBit(PORTC, 2) = 1 then
But = But OR %00000100
end if
Usart_Write(But)
Usart_Write(sX)
Usart_Write(sY)
delay_ms(10)
goto lop
end.
[/SOURCE CODE]
weiter mit: Sensor einbauen ⇒
Einkaufsliste
Material:
-
MEMS Beschleunigungssensor
-
PIC Mikrocontroller
-
PC-Maus
-
weitere Elektronikbauteile (siehe Schaltplan)
Redaktionstipps
|
|
|
|
|
|
|
Kommentare