Category : avr

Looking at the source-code of the Arduino-Ethernet-Library I found this: class DhcpClass { private: … #ifdef __arm__ uint8_t _dhcpLocalIp[4] __attribute__((aligned(4))); uint8_t _dhcpSubnetMask[4] __attribute__((aligned(4))); uint8_t _dhcpGatewayIp[4] __attribute__((aligned(4))); uint8_t _dhcpDhcpServerIp[4] __attribute__((aligned(4))); uint8_t _dhcpDnsServerIp[4] __attribute__((aligned(4))); #else uint8_t _dhcpLocalIp[4]; uint8_t _dhcpSubnetMask[4]; uint8_t _dhcpGatewayIp[4]; uint8_t _dhcpDhcpServerIp[4]; uint8_t _dhcpDnsServerIp[4]; #endif … aswell as this: void DhcpClass::reset_DHCP_lease() { // zero out _dhcpSubnetMask, ..

Read more

I’m trying to read to calculate the capacitance with the Arduino Uno. I did this successfully with the Arduino function. unsigned long starttime = 0; unsigned long endtime = 0; double C = 0; float n = 3.0; //time constant float resistor = n * 998000.0; int analogValue = 0; void setup() { Serial.begin(9600); pinMode(5, ..

Read more

I thought anonymous namespaces were file-wide scope only? If I get a redefinition error, as I do with the below example code, then what is the point? file1.cpp: namespace my_namespace { namespace /* anon */ { int my_file_wide_scoped_value = 0; // Ok: works just fine… } // namespace } // namespace file2.cpp: namespace my_namespace { ..

Read more

I am trying to write a program that will allow me to use an arduino leonard as a controller on an xbox original. I am currently running into the error below: C:UsersConnorAppDataLocalTempccEeKoBr.ltrans0.ltrans.o: In function `xbox_init’: C:UsersConnorDesktopX360ToOG/XBOXPad.c:175: undefined reference to `USB_Init’ C:UsersConnorAppDataLocalTempccEeKoBr.ltrans0.ltrans.o: In function `HID_Task’: C:UsersConnorDesktopX360ToOG/XBOXPad.c:122: undefined reference to `USB_DeviceState’ C:UsersConnorDesktopX360ToOG/XBOXPad.c:131: undefined reference to `Endpoint_Write_Stream_LE’ C:UsersConnorAppDataLocalTempccEeKoBr.ltrans0.ltrans.o: ..

Read more

I have been learning the make program. I wanna to program LCD by the AtMega8 and compile it with the Makefile. I wrote this basic code: #ifndef __AVR_ATmega8__ #define __AVR_ATmega8__ #endif #define F_CPU 8000000UL #include <avr/io.h> #include <util/delay.h> #include "hd44780.h" int main(void) { lcd_init(); lcd_clrscr(); lcd_puts("Hello World"); while (1); return 0; } And I wrote ..

Read more

I wrote a c++ code in avr version 4.14 for atmega328p #include <avr/io.h> #include <util/delay.h> int main(){ DDRB |= (1<<0x01); while(1) { PORTB |= (1<<0x01); _delay_ms(500); PORTB &= ~(1<<0x01); _delay_ms(500); } return 0; } It gives me that error that I don’t understand: ../test.c:21: fatal error: opening dependency file dep/test.o.d: No such file or directory ..

Read more