I am working on a Mac with Yosemite OS X and I'm trying to compile a program in C that I could then upload onto my Arduino. I am following a tutorial.
I tried going through and reinstalling avr-gcc, but I got the same output. I tried searching for…
I am currectly working on a project and it happens that I have to reverse the order of a byte. I am currently using AVR Studio Mega32 Microcontroller.
For example:
0000 0001 becomes 1000 0000
0001 0110 becomes 0110 1000
1101 1001 becomes 1001…
I have some code which should read the values of a couple of ADC pins, each time around the commutator loop.
static uint16_t adc0;
static uint16_t adc1;
void init(void) {
...
hw_configure_adcs();
...
}
void loop(void) {
...
…
I'm having trouble getting a rotary encoder to work properly with AVR micro controllers. The encoder is a mechanical ALPS encoder, and I'm using Atmega168.
Clarification
I have tried using an External Interrupt to listen to the pins, but it seems…
I am writing a communication between Atmega162 and PC.
On my PCB I have interface RS485 (converted from RS422 by MAX485) and it goes through ADAM-4520 transceiver into COM port.
I've been testing my program in terminal and it seems strange to me,…
I develop a C application with atmega168a-pu and interrupts. I use the following interrupts:
ISR(TIMER0_COMPA_vect);
ISR(TIMER0_COMPB_vect);
ISR (TIMER2_COMPA_vect);
ISR(SPI_STC_vect);
ISR(TIMER1_COMPA_vect);
ISR (PCINT1_vect);
and my code looks…
I need to send float data to Arduino from Python and get the same value back. I thought to send some float data from the Arduino first. The data is sent as 4 successive bytes. I'm trying to figure out how to collect these successive bytes and…
I've been trying to figure out why I cannot get a sensible value from multiplying an unsigned int with a float value.
Doing something like 65535*0.1 works as expected but multiplying a float with a uint from memory creates mad values. I have a…
Recently I tried to pack my code into small ATTiny13 with 1kB of flash. In optimalisation process I discovered something weird for me. Let's take the example code:
#include
int main() {
TCNT0 = TCNT0 * F_CPU / 58000;
}
It has…
I am using an ATmega32 to interrupt every 32ms to do some arbitrary stuff, which isn't really important for now.
I'm using the timer overflow of timer0 to interrupt, which works predictably and perfectly.
My problem is I have a global…
I would like to remotely reprogram my Arduino via Android over Bluetooth SPP. The first step is to reset the ATMEGA microcontroller. This is accomplished on the Arduino by toggling the DTR line. Is there any API to control the Bluetooth SPP control…
I have written the code below in order to make an ATMEGA168A blink a small led:
#include
#include
#define F_CPU 1000000UL
int main(void)
{
DDRB = 0b00000010;
PORTB = 0b00000000;
while(1)
{
PORTB…
I would think this question has been asked thousands of times, I simply cannot find many resources on the subject.
I would like to program my Arduino Uno (ATmega328P) using Atmel Studio and the C language, minus the Arduino Libraries. What I mean by…