 	EEPROM.put(EEPROM_RECORD_ADDRESS, eeprom_record);
 }
 
-void set_lamp(uint8_t brightness) {
-	analogWrite(LIGHT_PIN, brightness);
-}
-
-/* turn laser on or off (pull npn base up to turn the laser on) */
-void set_laser(bool is_on) {
-	if (is_on)
-		PORTB |= LASER_MASK;
-	else
-		PORTB &= ~LASER_MASK;
+void test_power() {
+	if (!(PINB & POWER_MASK)) {
+		set_lamp(0);
+		Serial.println(F("no power, write current position to eeprom!"));
+		write_current_position_to_eeprom();
+		Serial.println(F("wait for capacitors to discharge..."));
+		set_lamp(255);
+		while (true);
+	}
 }
 
 void busy_delay(uint32_t ms) {

#define BEZIER_SEGMENTS				(30)
// #define STEPS_PER_RADIAN			(648.68)
// #define Z_SQARE						(10000) // 19700
#define LAMP_FADE_MS				(100)
#define EEPROM_RECORD_ADDRESS		(0)
#define EEPROM_STATUS_VALID			(0x55)
// #define EEPROM_STATUS_INVALID		(0xAA)

	set_lamp(255);
	go_home();
	delay(1000);
	while(!(PINB & BUTTON_MASK));
}

/* draw regular polygon x, y are the center point with absolute_steps */
