You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB
Arduino

5 years ago
#include <TVout.h>
#include <fontALL.h>
TVout TV;
unsigned char x,y,z;
void setup() {
x=0;
y=0;
z=0;
Serial.begin(9600);
TV.begin(PAL); //for devices with only 1k sram(m168) use TV.begin(_NTSC,128,56)
TV.select_font(font6x8);
Serial.println(TV.vres());
Serial.println(TV.hres());
}
void loop() {
TV.clear_screen();
for(x=0;x<TV.hres();x++){
z=random(TV.vres());
for(y=0;y<TV.vres();y++){
if(analogRead(A0)<205){
TV.set_pixel(x+random(TV.hres()/12),random(z,TV.vres()/4-z),1);
}
if(analogRead(A0)>205 && analogRead(A0)<410){
TV.set_pixel(x+random(TV.hres()/10),random(z,TV.vres()/2.3-z),1);
}
if(analogRead(A0)>410 && analogRead(A0)<615){
TV.set_pixel(x+random(TV.hres()/8),random(z,TV.vres()/2-z),1);
}
if(analogRead(A0)>615 && analogRead(A0)<820){
TV.set_pixel(x+random(TV.hres()/6),random(z,TV.vres()/1.2-z),2);
}
if(analogRead(A0)>820){
TV.set_pixel(x+random(TV.hres()/4),random(z,TV.vres()-z),3);
}
//TV.set_pixel(x+random(50),y+random(y,y*5),analogRead(A0)/10);
//TV.delay(1000);
}
}
}