#include <avr/io.h>
//#include “atmega328p.def”
//typedef bool charMapType[8][8];
unsigned char bigHeart = {
0x66,
0xFF,
0xFF,
0xFF,
0x7E,
0x3C,
0x00
};
const int columnPins = { 6,11,10,3,17,4,8,9 };
const int rowPins = { 2,7,19,5,13,18,12,16 };
void setup() {
int i;
for ( i = 0; i < 8; i++)
{
pinMode(rowPins*, OUTPUT); // make all the LED pins outputs*
_ pinMode(columnPins*, OUTPUT);_
_ digitalWrite(columnPins, HIGH); // disconnect column pins from Ground*
* }
}
void loop() {
int pulseDelay = 800 ; // milliseconds to wait between beats*
* show(smallHeart, 80); // show the small heart image for 100 ms*
* show(bigHeart, 160); // followed by the big heart for 200ms*
* delay(pulseDelay); // show nothing between beats*
}
// routine to show a frame of an image stored in the array pointed to by the image parameter.
// the frame is repeated for the given duration in milliseconds
void show( byte * image, unsigned long duration)
{
* unsigned long start = millis(); // begin timing the animation*
* while (start + duration > millis()) // loop until the duration period has passed*
* {
for(int row = 0; row < 8; row++)
{
digitalWrite(rowPins[row], HIGH); // connect row to +5 volts*
* for(int column = 0; column < 8; column++)
{
boolean pixel = bitRead(image[row],column);
if(pixel == 1)
{
digitalWrite(columnPins[column], LOW); // connect column to Gnd*
* }
delayMicroseconds(300); // a small delay for each LED*
* digitalWrite(columnPins[column], HIGH); // disconnect column from Gnd*
* }
digitalWrite(rowPins[row], LOW); // disconnect LEDs*
* }
}
}*
So it also keeps telling me OUTPUT and HIGH aren’t found.
using this to produce the disassembly code:
avr-gcc -mmcu=atmega328p -Wall -Os -o heart.elf heart.c_