 	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) {


	while (true) {
		command = pgm_read_byte(path++);
		Serial.print(F("command: "));
		Serial.println(command);
		arguments_count = -1;
		for (uint8_t i = 0; i < sizeof(PATH_COMMAND_ARGUMENTS); i += 2) {
			Serial.println(PATH_COMMAND_ARGUMENTS[i]);
			if (command == PATH_COMMAND_ARGUMENTS[i]) {
				arguments_count = PATH_COMMAND_ARGUMENTS[i + 1];
				break;
			}
		}
		arguments_count *= sizeof(*arguments);
		Serial.print(F("arguments_count: "));
		Serial.println(arguments_count);
		if (arguments_count > sizeof(arguments) * sizeof(*arguments)) {
			Serial.println(F("Command error!"));
			return;

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

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