/*
beverly-crusher (build 82) [http://electronoob.com]
Released under the terms of the MIT license.
Copyright (c) 2014 electronoob.
All rights reserved.
*/
#include <avr/pgmspace.h>
/* truncated example sample see github for working and complete example */
prog_uchar onebitraw[] PROGMEM = {
0XFF, 0XFF, 0XEF, 0XFF, 0XFB, 0XFF,...
}
#define BC_BIT_COUNT 23040
#define BC_BYTE_COUNT 2880
#define SPK_PIN 5
void setup(){ pinMode(SPK_PIN, OUTPUT); }
void loop(){
unsigned char bite;
int col; col = 0;
int i;
for(i=0;i<BC_BYTE_COUNT;i++){
bite = pgm_read_byte_near(onebitraw + i);
/* let's break up our byte into it's constituent parts. */
unsigned char mask = 1;
unsigned char copy = bite;
int z;
for (z=0;z<8;z++) {
digitalWrite(SPK_PIN, copy & mask);
copy = copy >> 1;
delayMicroseconds(227);
}
}
}
https://github.com/electronoob/beverly-crusher/blob/master/arduino/example/example.ino
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.