Ir ao conteúdo
  • Cadastre-se

Progamação de um Propeller Clock?


usuario4

Posts recomendados

Olá agradeço a ajuda...

qual motor posso usar? Um motor de impressora DC serve?

A lista de materias que tenho que comprar?

Como progamar o PIC?

Se possível o modelo da placa para eu imprimir e fazê-la?

Como fazer para alimentar a placa sendo que esta está girando? Sei as maneiras possíveis mas qual é a melhor? Um tutorial com algumas fotos, por favor. Ajudaria bastante. Muito obrigado desde já.

Olá agradeço a ajuda...

qual motor posso usar? Um motor de impressora DC serve?

A lista de materias que tenho que comprar?

Como progamar o PIC?

Se possível o modelo da placa para eu imprimir e fazê-la?

Como fazer para alimentar a placa sendo que esta está girando? Sei as maneiras possíveis mas qual é a melhor? Um tutorial com algumas fotos, por favor. Ajudaria bastante. Muito obrigado desde já.

Link para o comentário
Compartilhar em outros sites

Usuário4, pode fazer esse do link que o Fervolt passou, eu fiz semana passada e deu certo.

O código é feito para CCS.

Use qualquer motor de brinquedo, eu usei um que achei aqui nos entulhos de eletônica ele é de 12V.

A lista dos materiais está no link.

A alimentação do motor é uma, a alimentação do PIC com os LEDs é outra, vem de duas baterias tipo CR2016 ligadas em série dentro de um Suporte para bateria CR2032 para dar 6 volts (não, não queima o pic) ela estará presa na própria paleta girando junto com os LEDs e PIC.

Lista de materiais

1 PIC16F628A – Microcontrolador Microchip

8 Led 3mm – cor a escolher

1 220R – 2 Watts – 5% - resistor de filme metálico

1 Placa padrão ilhada de fibra de vidro – 20 x 10 cm

1 Suporte para bateria CR2032

2 Baterias CR2016

1 Sensor de efeito hall A3240 ou equivalente – Alegro Micro

1 Motor spindle de DVD com prato - 5 volts

1 100nF – Capacitor cerâmico disco

1 10K – 1/8W – 5% - Resistor comum

1 Ponte de pinos (20 ou 40 pinos) em linha tipo mini-modu ou DuPont

1 Jumper tipo de Placa-mãe de PC

1 Caixa patola – que comporte 4 pilhas AA

1 Chave ON/OFF - 1 pólo - metal

1 Imã de neodímio – 3 x 3mm ou 5 x 5mm cilindrico

Link para o comentário
Compartilhar em outros sites

Bom dia,

As 2 baterias CR2016 desse projeto duram cerca de 8 horas contínuas em funcionamento, só não pode esquecer de desligar antes de guardar, como já aconteceu comigo...(_(

Att,

boa noite senhores projetinho interessante deu erro na compilação da pasta como posso resolver ? tenho que salvar algum arquivo na pastinha drive do CSS pois ja é bastante antigo talvez esteja desatualizado ?

Bom dia,

O compilador não encontrou o include propeller.h, verifique se no diretório onde está o projeto tem esse arquivo.

Att,

Link para o comentário
Compartilhar em outros sites

desculpe a ignorância mas o propeller seria este? devo salvar na pasta dos drive do Ccs se sim qual a extensão que devo salva lo ?

#include "propeller.h"

#include "graphics.c"

int8 letra[5];

void texto57(char* textptr, int posicao){

int8 h;

h = 0;

textptr += posicao;

if(*textptr < 'S')

memcpy(letra, FONT[*textptr - ' '], 5);

else if(*textptr <= '~')

memcpy(letra, FONT2[*textptr - 'S'], 5);

else

memcpy(letra, FONT[0], 5);

}

//****************** Rotina principal ******************//

void main(){

int8 n, m, inicio, fim, atual, tamanho, comeco;

char texto[] = " Feliz 2012 a todos do Forum Clube do Hardware!! ";

*cmcon = 0x07;

atual = 0;

m=0;

tamanho = sizeof(texto)-2;

output_b(255);

output_bit(pin_a6, 1);

output_bit(pin_a7, 1);

delay_ms(3000); //Acende todos os leds por 3 segundos, para teste

while(1){

if(!input(PIN_A0)){

delay_ms(5);

for(inicio = 0; inicio < 17; inicio++){

if(fim+inicio < tamanho){

texto57(texto, fim+inicio);

}else{

fim = 0;

}

for(n = 0; n < 5; n++){

output_bit(pin_a6, bit_test(letra[n], 4));

output_bit(pin_a7, bit_test(letra[n], 6));

output_b(letra[n]);

delay_us(180);

output_low(pin_a6);

output_low(pin_a7);

output_b(0);

delay_us(230);

}

delay_us(320);

}

m++;

if(m == 2){

atual++;

fim++;

m = 0;

}

}

}

//*********** FIM LOOP PRINCIPAL *************

}

Link para o comentário
Compartilhar em outros sites

Amigo, acho que você tá confundindo as coisas.

propeller.c é o arquivo do código fonte DENTRO do arquivo fonte citado só vai ter 2 includes como abaixo:

#include <16F628A.h>

#include "graphics.c"

Basta ter o arquivo graphics.c salvo no mesmo diretório do fonte.

Ai vai o fonte funcionando perfeitamente:

Arquivo Fonte: propeller.c

#include <16F628A.h>

#include "graphics.c"

#FUSES NOWDT //No Watch Dog Timer

#FUSES INTRC_IO //Internal RC Osc, no CLKOUT

#FUSES PUT //Power Up Timer

#FUSES NOPROTECT //Code not protected from reading

#FUSES NOBROWNOUT //No brownout reset

#FUSES MCLR //Master Clear pin enabled

#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O

#FUSES NOCPD //No EE protection

//#FUSES RESERVED //Used to set the reserved FUSE bits

#use delay(clock=4000000)

int8 letra[5];

void texto57(char* textptr, int posicao){

int8 h;

h = 0;

textptr += posicao;

if(*textptr < 'S')

memcpy(letra, FONT[*textptr - ' '], 5);

else if(*textptr <= '~')

memcpy(letra, FONT2[*textptr - 'S'], 5);

else

memcpy(letra, FONT[0], 5);

}

//****************** Rotina principal ******************//

void main(){

int8 n, m, inicio, fim, atual, tamanho; //cmcon; //comeco;

//char texto[] = " "; // EXEMPLO DE 79 CARACTERES.

char texto[] = " Teste Teste Teste Teste teste "; // Número máximo de caracteres = 79 (incluindo espaços)

setup_comparator(NC_NC_NC_NC);

// *cmcon = 0x07;

atual = 0;

m=0;

tamanho = sizeof(texto)-2;

output_b(255);

output_bit(pin_a6, 1);

output_bit(pin_a7, 1);

delay_ms(3000); //Acende todos os leds por 3 segundos, para teste

while(true){

if(!input(PIN_A0)){

delay_ms(5);

for(inicio = 0; inicio < 17; inicio++){

if(fim+inicio < tamanho)

{

texto57(texto, fim+inicio);

}

else

{

fim = 0;

}

for(n = 0; n < 5; n++){

output_bit(pin_a6, bit_test(letra[n], 4));

output_bit(pin_a7, bit_test(letra[n], 6));

output_b(letra[n]);

delay_us(180);

output_low(pin_a6);

output_low(pin_a7);

output_b(0);

delay_us(230);

}

delay_us(320);

}

m++;

if(m == 2){

atual++;

fim++;

m = 0;

}

}

}

//*********** FIM LOOP PRINCIPAL *************

}

Arquivo graphics.c

/////////////////////////////////////////////////////////////////////////

//// graphics.c ////

//// ////

//// This file contains functions to draw lines, rectangles, bars, ////

//// circles and text to a display. A function which draws a ////

//// single pixel must be defined before calling the functions in ////

//// this file. Call it glcd_pixel(x, y, color) where x is the ////

//// horizontal coordinate, y is the vertical coordinate, and ////

//// color is 1 bit to turn the pixel on or off. ////

//// ////

//// * Note: (0, 0) is treated as the upper left corner ////

//// ////

/////////////////////////////////////////////////////////////////////////

//// ////

//// glcd_line(x1, y1, x2, y2, color) ////

//// * Draws a line from the first point to the second point ////

//// with the given color ////

//// - color can be ON or OFF ////

//// ////

//// glcd_rect(x1, y1, x2, y2, fill, color) ////

//// * Draws a rectangle with one corner at point (x1,y1) and ////

//// the other corner at point (x2,y2) ////

//// - fill can be YES or NO ////

//// - color can be ON or OFF ////

//// ////

//// glcd_bar(x1, y1, x2, y2, width, color) ////

//// * Draws a bar (wide line) from the first point to the ////

//// second point ////

//// - width is the number of pixels wide ////

//// - color is ON or OFF ////

//// ////

//// glcd_circle(x, y, radius, fill, color) ////

//// * Draws a circle with center at (x,y) ////

//// - fill can be YES or NO ////

//// - color can be ON or OFF ////

//// ////

//// glcd_text57(x, y, textptr, size, color) ////

//// * Write the null terminated text pointed to by textptr with ////

//// the upper left coordinate of the first character at (x,y) ////

//// Characters are 5 pixels wide and 7 pixels tall ////

//// - size is an integer that scales the size of the text ////

//// - color is ON or OFF ////

//// * Note - This function wraps characters to the next line ////

//// use #define GLCD_WIDTH to specify a display width ////

//// ////

/////////////////////////////////////////////////////////////////////////

//// © Copyright 1996, 2004 Custom Computer Services ////

//// This source code may only be used by licensed users of the CCS ////

//// C compiler. This source code may only be distributed to other ////

//// licensed users of the CCS C compiler. No other use, ////

//// reproduction or distribution is permitted without written ////

//// permission. Derivative programs created using this software ////

//// in object code form are not restricted in any way. ////

/////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////

#ifndef GRAPHICS_DRAWING_FUNCTIONS

#define GRAPHICS_DRAWING_FUNCTIONS

/////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////

#ifndef ON

#define ON 1

#endif

#ifndef OFF

#define OFF 0

#endif

#ifndef YES

#define YES 1

#endif

#ifndef NO

#define NO 0

#endif

/////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////

//// Defines a 5x7 font

/////////////////////////////////////////////////////////////////////////

const int8 FONT[51][5] ={0x00, 0x00, 0x00, 0x00, 0x00, // SPACE

0x00, 0x00, 0x5F, 0x00, 0x00, // !

0x00, 0x03, 0x00, 0x03, 0x00, // "

0x14, 0x3E, 0x14, 0x3E, 0x14, // #

0x24, 0x2A, 0x7F, 0x2A, 0x12, // $

0x43, 0x33, 0x08, 0x66, 0x61, // %

0x36, 0x49, 0x55, 0x22, 0x50, // &

0x00, 0x05, 0x03, 0x00, 0x00, // '

0x00, 0x1C, 0x22, 0x41, 0x00, // (

0x00, 0x41, 0x22, 0x1C, 0x00, // )

0x14, 0x08, 0x3E, 0x08, 0x14, // *

0x08, 0x08, 0x3E, 0x08, 0x08, // +

0x00, 0x50, 0x30, 0x00, 0x00, // ,

0x08, 0x08, 0x08, 0x08, 0x08, // -

0x00, 0x60, 0x60, 0x00, 0x00, // .

0x20, 0x10, 0x08, 0x04, 0x02, // /

0x3E, 0x51, 0x49, 0x45, 0x3E, // 0

0x00, 0x04, 0x02, 0x7F, 0x00, // 1

0x42, 0x61, 0x51, 0x49, 0x46, // 2

0x22, 0x41, 0x49, 0x49, 0x36, // 3

0x18, 0x14, 0x12, 0x7F, 0x10, // 4

0x27, 0x45, 0x45, 0x45, 0x39, // 5

0x3E, 0x49, 0x49, 0x49, 0x32, // 6

0x01, 0x01, 0x71, 0x09, 0x07, // 7

0x36, 0x49, 0x49, 0x49, 0x36, // 8

0x26, 0x49, 0x49, 0x49, 0x3E, // 9

0x00, 0x36, 0x36, 0x00, 0x00, // :

0x00, 0x56, 0x36, 0x00, 0x00, // ;

0x08, 0x14, 0x22, 0x41, 0x00, // <

0x14, 0x14, 0x14, 0x14, 0x14, // =

0x00, 0x41, 0x22, 0x14, 0x08, // >

0x02, 0x01, 0x51, 0x09, 0x06, // ?

0x3E, 0x41, 0x59, 0x55, 0x5E, // @

0x7E, 0x09, 0x09, 0x09, 0x7E, // A

0x7F, 0x49, 0x49, 0x49, 0x36, // B

0x3E, 0x41, 0x41, 0x41, 0x22, // C

0x7F, 0x41, 0x41, 0x41, 0x3E, // D

0x7F, 0x49, 0x49, 0x49, 0x41, // E

0x7F, 0x09, 0x09, 0x09, 0x01, // F

0x3E, 0x41, 0x41, 0x49, 0x3A, // G

0x7F, 0x08, 0x08, 0x08, 0x7F, // H

0x00, 0x41, 0x7F, 0x41, 0x00, // I

0x30, 0x40, 0x40, 0x40, 0x3F, // J

0x7F, 0x08, 0x14, 0x22, 0x41, // K

0x7F, 0x40, 0x40, 0x40, 0x40, // L

0x7F, 0x02, 0x0C, 0x02, 0x7F, // M

0x7F, 0x02, 0x04, 0x08, 0x7F, // N

0x3E, 0x41, 0x41, 0x41, 0x3E, // O

0x7F, 0x09, 0x09, 0x09, 0x06, // P

0x1E, 0x21, 0x21, 0x21, 0x5E, // Q

0x7F, 0x09, 0x09, 0x09, 0x76};// R

const int8 FONT2[44][5]={0x26, 0x49, 0x49, 0x49, 0x32, // S

0x01, 0x01, 0x7F, 0x01, 0x01, // T

0x3F, 0x40, 0x40, 0x40, 0x3F, // U

0x1F, 0x20, 0x40, 0x20, 0x1F, // V

0x7F, 0x20, 0x10, 0x20, 0x7F, // W

0x41, 0x22, 0x1C, 0x22, 0x41, // X

0x07, 0x08, 0x70, 0x08, 0x07, // Y

0x61, 0x51, 0x49, 0x45, 0x43, // Z

0x00, 0x7F, 0x41, 0x00, 0x00, // [

0x02, 0x04, 0x08, 0x10, 0x20, // \

0x00, 0x00, 0x41, 0x7F, 0x00, // ]

0x04, 0x02, 0x01, 0x02, 0x04, // ^

0x40, 0x40, 0x40, 0x40, 0x40, // _

0x00, 0x01, 0x02, 0x04, 0x00, // `

0x20, 0x54, 0x54, 0x54, 0x78, // a

0x7F, 0x44, 0x44, 0x44, 0x38, // b

0x38, 0x44, 0x44, 0x44, 0x44, // c

0x38, 0x44, 0x44, 0x44, 0x7F, // d

0x38, 0x54, 0x54, 0x54, 0x18, // e

0x04, 0x04, 0x7E, 0x05, 0x05, // f

0x08, 0x54, 0x54, 0x54, 0x3C, // g

0x7F, 0x08, 0x04, 0x04, 0x78, // h

0x00, 0x44, 0x7D, 0x40, 0x00, // i

0x20, 0x40, 0x44, 0x3D, 0x00, // j

0x7F, 0x10, 0x28, 0x44, 0x00, // k

0x00, 0x41, 0x7F, 0x40, 0x00, // l

0x7C, 0x04, 0x78, 0x04, 0x78, // m

0x7C, 0x08, 0x04, 0x04, 0x78, // n

0x38, 0x44, 0x44, 0x44, 0x38, // o

0x7C, 0x14, 0x14, 0x14, 0x08, // p

0x08, 0x14, 0x14, 0x14, 0x7C, // q

0x00, 0x7C, 0x08, 0x04, 0x04, // r

0x48, 0x54, 0x54, 0x54, 0x20, // s

0x04, 0x04, 0x3F, 0x44, 0x44, // t

0x3C, 0x40, 0x40, 0x20, 0x7C, // u

0x1C, 0x20, 0x40, 0x20, 0x1C, // v

0x3C, 0x40, 0x30, 0x40, 0x3C, // w

0x44, 0x28, 0x10, 0x28, 0x44, // x

0x0C, 0x50, 0x50, 0x50, 0x3C, // y

0x44, 0x64, 0x54, 0x4C, 0x44, // z

0x00, 0x08, 0x36, 0x41, 0x41, // {

0x00, 0x00, 0x7F, 0x00, 0x00, // |

0x41, 0x41, 0x36, 0x08, 0x00, // }

0x02, 0x01, 0x02, 0x04, 0x02};// ~

/////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////

// Purpose: Draw a line on a graphic LCD using Bresenham's

// line drawing algorithm

// Inputs: (x1, y1) - the start coordinate

// (x2, y2) - the end coordinate

// color - ON or OFF

// Dependencies: glcd_pixel()

/////////////////////////////////////////////////////////////////////////

#ifdef LARGE_LCD

void glcd_line(int16 x1, int16 y1, int16 x2, int16 y2, int1 color)

#else

void glcd_line(int8 x1, int8 y1, int8 x2, int8 y2, int1 color)

#endif

{

int16 dy, dx;

signed int8 addx=1, addy=1;

signed int16 P, diff;

#ifdef LARGE_LCD

int16 i=0;

dx = abs((signed int16)(x2 - x1));

dy = abs((signed int16)(y2 - y1));

#else

int8 i=0;

dx = abs((signed int8)(x2 - x1));

dy = abs((signed int8)(y2 - y1));

#endif

if(x1 > x2)

addx = -1;

if(y1 > y2)

addy = -1;

if(dx >= dy)

{

dy *= 2;

P = dy - dx;

diff = P - dx;

for(; i<=dx; ++i)

{

glcd_pixel(x1, y1, color);

if(P < 0)

{

P += dy;

x1 += addx;

}

else

{

P += diff;

x1 += addx;

y1 += addy;

}

}

}

else

{

dx *= 2;

P = dx - dy;

diff = P - dy;

for(; i<=dy; ++i)

{

glcd_pixel(x1, y1, color);

if(P < 0)

{

P += dx;

y1 += addy;

}

else

{

P += diff;

x1 += addx;

y1 += addy;

}

}

}

}

/////////////////////////////////////////////////////////////////////////

// Purpose: Draw a rectangle on a graphic LCD

// Inputs: (x1, y1) - the start coordinate

// (x2, y2) - the end coordinate

// fill - YES or NO

// color - ON or OFF

// Dependencies: glcd_pixel(), glcd_line()

/////////////////////////////////////////////////////////////////////////

#ifdef LARGE_LCD

void glcd_rect(int16 x1, int16 y1, int16 x2, int16 y2, int1 fill, int1 color)

#else

void glcd_rect(int8 x1, int8 y1, int8 x2, int8 y2, int1 fill, int1 color)

#endif

{

if(fill)

{

#ifdef LARGE_LCD

int16 i, xmin, xmax, ymin, ymax;

#else

int8 i, xmin, xmax, ymin, ymax;

#endif

if(x1 < x2) // Find x min and max

{

xmin = x1;

xmax = x2;

}

else

{

xmin = x2;

xmax = x1;

}

if(y1 < y2) // Find the y min and max

{

ymin = y1;

ymax = y2;

}

else

{

ymin = y2;

ymax = y1;

}

for(; xmin <= xmax; ++xmin)

{

for(i=ymin; i<=ymax; ++i)

{

glcd_pixel(xmin, i, color);

}

}

}

else

{

glcd_line(x1, y1, x2, y1, color); // Draw the 4 sides

glcd_line(x1, y2, x2, y2, color);

glcd_line(x1, y1, x1, y2, color);

glcd_line(x2, y1, x2, y2, color);

}

}

/////////////////////////////////////////////////////////////////////////

// Purpose: Draw a bar (wide line) on a graphic LCD

// Inputs: (x1, y1) - the start coordinate

// (x2, y2) - the end coordinate

// width - The number of pixels wide

// color - ON or OFF

/////////////////////////////////////////////////////////////////////////

#ifdef LARGE_LCD

void glcd_bar(int16 x1, int16 y1, int16 x2, int16 y2, int8 width, int1 color)

#else

void glcd_bar(int8 x1, int8 y1, int8 x2, int8 y2, int8 width, int1 color)

#endif

{

int8 half_width;

signed int16 dy, dx;

signed int8 addx=1, addy=1, j;

signed int16 P, diff, c1, c2;

#ifdef LARGE_LCD

int16 i=0;

dx = abs((signed int16)(x2 - x1));

dy = abs((signed int16)(y2 - y1));

#else

int8 i=0;

dx = abs((signed int8)(x2 - x1));

dy = abs((signed int8)(y2 - y1));

#endif

half_width = width/2;

c1 = -(dx*x1 + dy*y1);

c2 = -(dx*x2 + dy*y2);

if(x1 > x2)

{

signed int16 temp;

temp = c1;

c1 = c2;

c2 = temp;

addx = -1;

}

if(y1 > y2)

{

signed int16 temp;

temp = c1;

c1 = c2;

c2 = temp;

addy = -1;

}

if(dx >= dy)

{

P = 2*dy - dx;

diff = P - dx;

for(i=0; i<=dx; ++i)

{

for(j=-half_width; j<half_width+width%2; ++j)

{

#ifdef LARGE_LCD

int16 temp;

#else

int8 temp;

#endif

temp = dx*x1+dy*(y1+j); // Use more RAM to increase speed

if(temp+c1 >= 0 && temp+c2 <=0)

glcd_pixel(x1, y1+j, color);

}

if(P < 0)

{

P += 2*dy;

x1 += addx;

}

else

{

P += diff;

x1 += addx;

y1 += addy;

}

}

}

else

{

P = 2*dx - dy;

diff = P - dy;

for(i=0; i<=dy; ++i)

{

if(P < 0)

{

P += 2*dx;

y1 += addy;

}

else

{

P += diff;

x1 += addx;

y1 += addy;

}

for(j=-half_width; j<half_width+width%2; ++j)

{

#ifdef LARGE_LCD

int16 temp;

#else

int8 temp;

#endif

temp = dx*x1+dy*(y1+j); // Use more RAM to increase speed

if(temp+c1 >= 0 && temp+c2 <=0)

glcd_pixel(x1+j, y1, color);

}

}

}

}

/////////////////////////////////////////////////////////////////////////

// Purpose: Draw a circle on a graphic LCD

// Inputs: (x,y) - the center of the circle

// radius - the radius of the circle

// fill - YES or NO

// color - ON or OFF

/////////////////////////////////////////////////////////////////////////

#ifdef LARGE_LCD

void glcd_circle(int16 x, int16 y, int16 radius, int1 fill, int1 color)

#else

void glcd_circle(int8 x, int8 y, int8 radius, int1 fill, int1 color)

#endif

{

#ifdef LARGE_LCD

signed int16 a, b, P;

#else

signed int8 a, b, P;

#endif

a = 0;

b = radius;

P = 1 - radius;

do

{

if(fill)

{

glcd_line(x-a, y+b, x+a, y+b, color);

glcd_line(x-a, y-b, x+a, y-b, color);

glcd_line(x-b, y+a, x+b, y+a, color);

glcd_line(x-b, y-a, x+b, y-a, color);

}

else

{

glcd_pixel(a+x, b+y, color);

glcd_pixel(b+x, a+y, color);

glcd_pixel(x-a, b+y, color);

glcd_pixel(x-b, a+y, color);

glcd_pixel(b+x, y-a, color);

glcd_pixel(a+x, y-b, color);

glcd_pixel(x-a, y-b, color);

glcd_pixel(x-b, y-a, color);

}

if(P < 0)

P += 3 + 2 * a++;

else

P += 5 + 2 * (a++ - b--);

} while(a <= B);

}

/////////////////////////////////////////////////////////////////////////

// Purpose: Write text on a graphic LCD

// Inputs: (x,y) - The upper left coordinate of the first letter

// textptr - A pointer to an array of text to display

// size - The size of the text: 1 = 5x7, 2 = 10x14, ...

// color - ON or OFF

/////////////////////////////////////////////////////////////////////////

#ifdef LARGE_LCD

void glcd_text57(int16 x, int16 y, char* textptr, int8 size, int1 color)

#else

void glcd_text57(int8 x, int8 y, char* textptr, int8 size, int1 color)

#endif

{

int8 j, k, l, m; // Loop counters

int8 pixelData[5]; // Stores character data

for(; *textptr != '\0'; ++textptr, ++x)// Loop through the passed string

{

if(*textptr < 'S') // Checks if the letter is in the first font array

memcpy(pixelData, FONT[*textptr - ' '], 5);

else if(*textptr <= '~') // Check if the letter is in the second font array

memcpy(pixelData, FONT2[*textptr - 'S'], 5);

else

memcpy(pixelData, FONT[0], 5); // Default to space

// Handles newline and carriage returns

switch(*textptr)

{

case '\n':

y += 7*size + 1;

continue;

case '\r':

x = 0;

continue;

}

if(x+5*size >= GLCD_WIDTH) // Performs character wrapping

{

x = 0; // Set x at far left position

y += 7*size + 1; // Set y at next position down

}

for(j=0; j<5; ++j, x+=size) // Loop through character byte data

{

for(k=0; k < 7; ++k) // Loop through the vertical pixels

{

if(bit_test(pixelData[j], k)) // Check if the pixel should be set

{

for(l=0; l < size; ++l) // These two loops change the

{ // character's size

for(m=0; m < size; ++m)

{

glcd_pixel(x+m, y+k*size+l, color); // Draws the pixel

}

}

}

}

}

}

}

#endif

Link para o comentário
Compartilhar em outros sites

salvei mas quando do f9 ele retorna com outro erro eu não devo ter salvado corretamente pode me falar com detalhes amigo de como posso salvar corretamente é que sempre costumo pegar programas simples sem ajustes como botão e led por exemplo

Olha aqui nesse LINK

Usei a menos de 2 semanas, tá funcionando direitinho, tem tb um esquema e a PCB (use o programa PCB Wizard 3.50) tem na net pra baixar.

Falou

Link para o comentário
Compartilhar em outros sites

OK vou baixar obrigado .

mas sem querer tirar o foco do tópico mas servira de exemplo para outros menos experiente como eu como devo fazer para meu ccs não dar erro uma vez que esta bom em pleno funcionamento esses tipo de problema seria porque meu ccs não tem o propeller em arquivo? ou seja tudo que é declarado tem que esta declarado por trás dentro do ccs? só por curiosidade porque já me deparei com esses problemas como não sou programador só a nível didático não procurei saber

Link para o comentário
Compartilhar em outros sites

No meu caso eu fiz "artesanalmente", a placa padrão ilhada da lista de materiais é pra isso, cortei uma faixa com 4 furos de largura para comportar os componentes, as ligações foram feitas com fio esmaltado #32 AWG. O suporte das baterias eu prendi com fio esmaltado mais grasso para poder mexer e achar o centro de equilíbrio da hélice.

Para a soldagem siga o esquema.

Att,

Link para o comentário
Compartilhar em outros sites

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...