Neste forum Polones há uma explicacao de como interfacear com o LCD 320×240 do Nokia E51:
http://www.elektroda.pl/rtvforum/viewtopic.php?t=1344700&sid=e2fac4ea42d6c7df3d88a62263350eea
a blog about computers and other funny things
Month: February 2011
Neste forum Polones há uma explicacao de como interfacear com o LCD 320×240 do Nokia E51:
http://www.elektroda.pl/rtvforum/viewtopic.php?t=1344700&sid=e2fac4ea42d6c7df3d88a62263350eea
Como já publicado anteriormente aqui, as TVs da Sony utilizam Linux internamente. Porém apesar disso não existe um projeto para tentar portar o Linux para elas.
A unica informacao que encontrei foi neste forum:
http://sourceforge.net/apps/phpbb/samygo/viewtopic.php?f=1&t=1058
Publiquei um video no youtube demonstrando o sistema steer-by-wire que estou desenvolvendo.
O video pode ser assistido no endereco:
Muitas vezes voce precisa de um exemplo simples de como fazer um programa de comunicacao serial no Linux, mas todos os exemplos que voce acha sao muito complexos e dificeis de entender.
Hoje precisei fazer um programa simples de comunicacao serial e passei por este mesmo problema, finalmente consegui encontrar um programa de exemplo (mais complexo do que eu queria) e modifiquei para que sei ficasse simples de entender e usar.
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/signal.h>
#include <sys/types.h>
#define BAUDRATE B19200
#define FALSE 0
#define TRUE 1
//
volatile int STOP=FALSE;
void signal_handler_IO (int status);
int wait_flag=TRUE;
char devicename[80] = "/dev/ttyUSB0", ch;
int status;
//
int main(int argc, char *argv[])
{
int fd, res, i;
struct termios newtio;
struct sigaction saio;
char buf[255];
//
//open the device in non-blocking way (read will return immediately)
fd = open(devicename, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd < 0)
{
perror(devicename);
exit(1);
}
//
//install the serial handler before making the device asynchronous
saio.sa_handler = signal_handler_IO;
sigemptyset(&saio.sa_mask); //saio.sa_mask = 0;
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,&saio,NULL);
//
// allow the process to receive SIGIO
fcntl(fd, F_SETOWN, getpid());
//
// make the file descriptor asynchronous
fcntl(fd, F_SETFL, FASYNC);
//
// set new port settings for canonical input processing
newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VMIN]=1;
newtio.c_cc[VTIME]=0;
tcflush(fd, TCIFLUSH);
tcsetattr(fd,TCSANOW,&newtio);
//
// loop while waiting for input. normally we would do something useful here
while (STOP == FALSE)
{
//
// read characters typed by user in non-blocking way
ch = getchar_unlocked();
if(ch > 0)
write(fd,&ch,1);
//
// after receiving SIGIO, wait_flag = FALSE, input is available and can be read */
if (wait_flag == FALSE) //if input is available
{
res = read(fd,buf,255);
if (res > 0)
{
for (i=0; i < res; i++) //for all chars in string
{
printf("%c", buf[i]);
}
}
wait_flag = TRUE; /* wait for new input */
}
}
close(fd);
}
//
/***************************************************************************
* signal handler. sets wait_flag to FALSE, to indicate above loop that *
* characters have been received. *
***************************************************************************/
//
void signal_handler_IO (int status)
{
//printf("received SIGIO signal.\n");
wait_flag = FALSE;
}
Compile da forma usual:
gcc serial.c -o serial
Com este programa é possível fazer comunicacao serial bidirecional entre dois dispositivos. Inicialmente eu testei comunicando com o bootloader de uma placa embarcada configurada para 19200 8N1. Basta alterar o baudrate para o valor desejado (ex. 115200) e recompilar.
This is tutorial to sniff USB communication using VMWare:
http://vusb-analyzer.sourceforge.net/tutorial.html
There is other alternative as using USB Snoop Pro, but for Windows:
http://sourceforge.net/projects/usbsnoop/
Tomi Liljemark fez a engenharia reversa do painel de instrumentacao do seu carro, ele analisou as mensagens no barramento CAN e descobriu o que cada uma significava:
When debugging low level function on NuttX you should to use it:
lib_lowprintf("I am here\n"); sleep(1);
Just remember to define in the config file:
CONFIG_DEV_LOWCONSOLE=y
Linux has an internal usb monitor called usbmon.
If you want to use it please read the documentation file:
linux/Documentation/usb/usbmon.txt
After selecting a bus number to sniff and generating the log file, just rename this file to something.mon and use vusb-analyzer to visualise it.
Download vusb-analyzer here:
http://vusb-analyzer.sourceforge.net/
Uso o Kile (antigo KTexMaker) ha’ alguns anos e gosto muito das facilidades que ele oferece.
Hoje tive que reinstala-lo num computador mais novo rodando Ubuntu 10.10
Embora eu ja’ tenha feito um post ha’ algum tempo atras ensinando como instala-lo no Ubuntu 8.04, resolvi documentar como fiz a instalacao e configuracao no Ubuntu 10.10:
sudo apt-get install texlive-latex-extra sudo apt-get install texlive-lang-portuguese sudo apt-get install texlive-fonts-recommended sudo apt-get install kile
A configuracao do Kile e’ simples, na barra de ferramentas modifique as seguintes opcoes dos combo-boxes:
– PDFLatex -> Latex
– ViewHTML -> ViewPDF
– Convert -> DVItoPDF
Em seguida modifique o visualizador de PDF de okular para evince:
– Settings -> Configure Kile -> Tools -> Build, entao clique em ViewPDF e modifique o commando de okular para evince, clique OK e pronto.
Enquanto procuro por material explicando como ler dados de um joystick (USB HID) encontrei um site com projetos interessantes. Resolvi adiciona-lo no meu favoritos: