cos ty nie ma nic, dali tylko jak przeslac dane na procka i tyle zabawy z diodami znalazlem fajny kurs ale tak zeby cos pokazac jak zaczac to nic... dzieki za pomoc w sieci malo jest takich konkretnych kursikow ktos powinien sie wziasc i napisac cos dla poczatkujacych tak jak jest to robione np w jezykach skryptowych w ktorych siedze ;/
Co do tego basenu olimpijskiego ja programuje w roznych jezykach i to na bardzo dobrym poziomie z c mam pierwszy raz do czynienia i mikrokontrolerami zazwyczaj moja dobra strona sa jezyki skryptowe na ktorych obecnie zarabiam

takze to nie jest tez jako taka olimpiada bo jakies tam zasady dzialania konstrukcje i harmonogram znam

im szybciej przeskocze wyzej tym latwiej bedzie mi przyswoic nowe rzeczy

sory ze tak was mecze w ogule wdzieczny jestem za cala pomoc ale temperature musze odpalic dalej juz sam bede dzialal i szukal odpowiedzi jak wiecie sami poczatki sa ciezkie..
a i ostatni moj problem tak sie zastanawiam bo nie wiem gdzie mam szukac takich rzeczy na ten temat:
ok mamy diode i mikrokontroler mowi nam kiedy ma sie zapalac a kiedy nie, super strasznie mi sie to podoba ale ok chce teraz w domu zrobic zeby mikrokontroler mrugal mi swiatlem pod napieciem 220V no ale wiadomo, nie przepuszcze takiego napiecia przez atmege bo mi zrobi jedna wielka grzanke, ale jak takie cos powinno wygladac zeby procesor sterowal napieciami tak wysokomi, jak to obejsc? moze to dla was banalne pytania ale dla mnie podstawa, ale chcialbym sie dowiedziec jak to jest, zawsze mnie to intrygowalo ;p bo np chce zrobic sterowanie pompa od pieca albo pobawic sie swiatlami pod wysokim napieciem a tu lipa, spalic uklad nie trudno takze zakupilem sobie troszke bezpiecznikow na czarna godzine ;d;d
-----------------------
w takim kodzie:
#include <avr/io.h>
#include "lcd.h"
#define PIN_1WIRE 0
#define PORT_1WIRE PIND
#define OUT_1WIRE_LOW PORT_1WIRE&=~(1<<PIN_1WIRE);
#define OUT_1WIRE_HIGH PORT_1WIRE|=1<<PIN_1WIRE;
#define DIR_1WIRE_IN DDRD&=~(1<<PIN_1WIRE);
#define DIR_1WIRE_OUT DDRD|=1<<PIN_1WIRE;
char cStringBuffer[8];
unsigned char uc1Wire_ResetPulse(void)
{
unsigned char ucPresenceImpulse;
OUT_1WIRE_LOW;
DIR_1WIRE_OUT;
delayus(500);
DIR_1WIRE_in;
delayus(30);
if(bit_is_clear(PORT_1WIRE, PIN_1WIRE))
{
ucPresenceImpulse=1;
}
else
{
ucPresenceImpulse=0;
}
delayus(470);
if(bit_is_set(PORT_1WIRE, PIN_1WIRE))
{
ucPresenceImpulse=1;
}
else
{
ucPresenceImpulse=0;
}
return PRESENCE
}
void v1Wire_SendBit(char cBit)
{
DIR_1WIRE_OUT;
delayus(5);
if(cBit==1}
{
DIR_1WIRE_in;
}
delayus(80);
DIR_1WIRE_in;
}
unsigned char uc1Wire_ReadBit(void)
{
unsigned char ucBit;
DIR_1WIRE_OUT;
delayus(2);
DIR_1WIRE_IN;
delayus(15);
if(bit_is_set(PORT_1WIRE, PIN_1WIRE))
{
ucBit-1;
}
else
{
ucBit=0;
}
return(ucBit);
}
void v1Wire_SendByte(char ucByteValue)
{
unsigned char ucCounter;
unsigned char ucValueToSend;
for(ucCounter=0; ucCounter<8; ucCounter++)
{
ucValueToSend = ucByteValue>>ucCounter;
ucValueToSend &= 0c01;
v1Wire_SendBit(ucValueToSend);
}
delayus(100);
}
unsogned char uv1Wire_ReadByte(void)
{
unsigned char ucCounter;
unsigned char ucReadByte = 0;
for(ucCounter=0; ucCounter<8; ucCounter++)
{
if(uc1Wire_ReadBit())
{
ucReadByte|=0x01<<iCounter
}
delayus(15);
}
return(ucReadByte);
}
int main(void)
{
unsigned char ucReset;
char cTemperatureH=0, cTemperatureL=0;
float fTemperature=0;
LCD_init();
LCD_clear();
LCD_putstr_p(PSTR("1-wire"));
delayms(200);
LCD_clear();
for(;;)
{
ucReset-uc1Wire_ResetPulse();
if(ucReset==1)
{
v1Wire_SendByte(0xCC);
v1Wire_SendByte(0x44);
delayms(750);
ucReset=uc1Wire_resetPulse();
v1Wire_SendByte(0xCC);
v1Wire_SendByte(0xBE);
cTemperatureL=uv1Wire_ReadByte();
cTemperatureH=uv1Wire_ReadByte();
ucReset=uc1Wire_resetPulse();
fTemperature=(float)(cTemperatureL+(cTemperatureH<<8))/16;
dtostrf(fTemperature,1,1,cStringBuffer);
LCD_xy(0,0);
LCD_putstr(cStringBuffer);
delayms(200);
}
else
{
LCD_xy(0,0);
LCD_putstr_P(PSTR("Cisza"));
takie bledy: ;( powoli szukam gdzie popelnilem blad gdzie zle napisalem ale potrzeba tu chyba fachowej reki ;/
Build started 18.2.2010 at 12:29:20
avr-gcc -mmcu=atmega16 -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT tem.o -MF dep/tem.o.d -c ../tem.c
../tem.c:2:17: error: lcd.h: No such file or directory
../tem.c: In function 'uc1Wire_ResetPulse':
../tem.c:21: warning: implicit declaration of function 'delayus'
../tem.c:22: error: 'DIR_1WIRE_in' undeclared (first use in this function)
../tem.c:22: error: (Each undeclared identifier is reported only once
../tem.c:22: error: for each function it appears in.)
../tem.c:45: error: 'PRESENCE' undeclared (first use in this function)
../tem.c:46: error: expected ';' before '}' token
../tem.c: In function 'v1Wire_SendBit':
../tem.c:54: error: expected ')' before '}' token
../tem.c:54: error: expected expression before '}' token
../tem.c: At top level:
../tem.c:55: error: expected identifier or '(' before '{' token
../tem.c:59: error: expected declaration specifiers or '...' before numeric constant
../tem.c:59: warning: data definition has no type or storage class
../tem.c:59: warning: type defaults to 'int' in declaration of 'delayus'
../tem.c:60: warning: data definition has no type or storage class
../tem.c:60: warning: type defaults to 'int' in declaration of 'DIR_1WIRE_in'
../tem.c:61: error: expected identifier or '(' before '}' token
../tem.c: In function 'uc1Wire_ReadBit':
../tem.c:75: warning: statement with no effect
../tem.c:94:18: error: invalid suffix "c01" on integer constant
../tem.c: At top level:
../tem.c:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'char'
../tem.c: In function 'main':
../tem.c:126: warning: implicit declaration of function 'LCD_init'
../tem.c:127: warning: implicit declaration of function 'LCD_clear'
../tem.c:128: warning: implicit declaration of function 'LCD_putstr_p'
../tem.c:128: warning: implicit declaration of function 'PSTR'
../tem.c:129: warning: implicit declaration of function 'delayms'
../tem.c:134: warning: value computed is not used
../tem.c:141: warning: implicit declaration of function 'uc1Wire_resetPulse'
../tem.c:144: warning: implicit declaration of function 'uv1Wire_ReadByte'
../tem.c:150: warning: implicit declaration of function 'dtostrf'
../tem.c:151: warning: implicit declaration of function 'LCD_xy'
../tem.c:152: warning: implicit declaration of function 'LCD_putstr'
../tem.c:158: warning: implicit declaration of function 'LCD_putstr_P'
make: *** [tem.o] Error 1
Build failed with 13 errors and 18 warnings...
Moderowany przez zumek:Autor, zamiast wykonać polecenie moderatora, po prostu usuwa wpis.
Owszem, post poprawiony, jednak daleki od wersji , którą można zaakceptować.
Niniejszym, udzielam ostrzeżenia #1 - regulamin p.6, 15